fix(audio): benchmark tagging on pre-staged AMI meetings#2187
fix(audio): benchmark tagging on pre-staged AMI meetings#2187mohammadaaftabv wants to merge 9 commits into
Conversation
| results = pipeline.run(executor) | ||
|
|
||
| num_tasks = len(results) if results else 0 | ||
| output_metrics = validate_tagging_outputs(results) |
There was a problem hiding this comment.
Tutorial now fails hard on empty-segment pipelines
validate_tagging_outputs raises RuntimeError when the pipeline produces zero tagged segments. Because there is no try/except around this call in the tutorial's main, any small or synthetic dataset that passes diarization but produces no PrepareModuleSegments output will crash with an unhandled exception — the PIPELINE COMPLETE block is never reached. Previously the tutorial logged num_tasks = 0 and completed normally, so this is a behavioural break for developers iterating against toy fixtures. Consider documenting in the tutorial that a non-trivial audio dataset producing at least one segment is required, or catching the validation error and printing a user-friendly hint before re-raising.
| source_id = data.get(self._unique_id_key) | ||
| if not source_id: | ||
| msg = f"Cannot repeat entry without '{self._unique_id_key}'" | ||
| raise ValueError(msg) |
There was a problem hiding this comment.
Use an explicit
None/empty-string check so that a legitimate ID value of 0 (or any other falsy non-empty value) does not incorrectly raise.
| source_id = data.get(self._unique_id_key) | |
| if not source_id: | |
| msg = f"Cannot repeat entry without '{self._unique_id_key}'" | |
| raise ValueError(msg) | |
| source_id = data.get(self._unique_id_key) | |
| if source_id is None or source_id == "": | |
| msg = f"Cannot repeat entry without '{self._unique_id_key}'" | |
| raise ValueError(msg) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
bf71137 to
00ff62a
Compare
|
🌿 Preview your docs: https://nvidia-preview-aaftabv-fix-audio-tagging-benchmarks.docs.buildwithfern.com/nemo/curator Here are the markdown pages you've updated: |
c0715c4 to
4dbec5b
Compare
884bb49 to
8facc37
Compare
07cbd64 to
2943bd1
Compare
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
4495478 to
f45278f
Compare
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Signed-off-by: V Mohammad Aaftab <aaftaabv@gmail.com>
Summary
Fix the two audio-tagging nightly benchmarks so they run representative AMI meeting audio and cannot pass after doing no useful work.
The effective PR is now 8 files (
+1136/-116). It keeps the benchmark focused on tagging, removes the earlier unrelated FLEURS/tutorial/notebook/runtime-download scope, and makes the AMI setup reproducible instead of relying on hand-built manifests or manual model copies. Test-file changes have been removed from the net PR diff.Workload
The entries use three AMI single-distant-microphone meetings with long, multi-speaker audio and overlap. The repeat entry processes each meeting twice with deterministic repeated IDs.
audio_tagging_tts_xennaaudio_tagging_tts_xenna_repeatFLEURS was not retained for tagging because its short, mostly single-speaker clips do not exercise the long-audio splitting, multi-speaker diarization, or overlap behavior that dominates this pipeline.
Reproducible Setup
Audio tagging now follows the same two-layer setup pattern as FLEURS:
--raw-data-dirand--no-auto-download.One-time setup:
python benchmarking/data_prep/prepare_audio_tagging_data.py \ --output-path {datasets_path}/audio_tagging_ami_sdm \ --model-output-path {model_weights_path}/audio_tagging/pyannote-speaker-diarization-community-1 \ --hf-repo-id <token-free-audio-tagging-assets-repo>If the PyAnnote snapshot already exists locally, pass
--model-source-pathto copy it instead of downloading it from the token-free assets repo.The prep script stages:
manifest.jsonlaudio/EN2002b.Array1-01.wavaudio/ES2004c.Array1-01.wavaudio/TS3003a.Array1-01.wavpyannote-speaker-diarization-community-1/It also verifies that the manifest has exactly the expected AMI rows, expected audio basenames, and unique nonempty
audio_item_idvalues. That makes missing or mis-staged data fail during setup instead of surfacing only after an expensive nightly run.Nightly Behavior
Nightly consumes only pre-staged local paths:
Nightly does not need
HF_TOKEN, does not download AMI or PyAnnote assets at runtime, and fails loudly if the staged dataset/model is missing or malformed.Standalone debugging can still auto-download into
<scratch-output-path>/audio_tagging_ami_sdmwhen--raw-data-diris omitted and--hf-repo-idorCURATOR_AUDIO_TAGGING_HF_REPO_IDis set. The standalone cache usesCURATOR_AUDIO_TAGGING_CACHE_DIRor/tmp/curator/audio_tagging_cache, so deleting scratch does not force blob refetches.Correctness Contract
Every downstream stage preserves outer
AudioTaskrows, so success requires:Success also requires:
ASRAlignment2,ComputeWER, andManifestWriterRepeated inputs receive deterministic IDs so resampled audio and RTTM files cannot collide.
Runtime Fixes
NeMoASRAlignerStageschema for second-pass segment mode.RepeatEntriesStageso it accepts valid falsy IDs like integer0while rejecting onlyNoneand the empty string.Validation
Current checks after the setup refactor:
ruff check benchmarking/data_prep/prepare_audio_tagging_data.py benchmarking/scripts/audio_tagging_benchmark.pyruff format --check benchmarking/data_prep/prepare_audio_tagging_data.py benchmarking/scripts/audio_tagging_benchmark.pypython3 -m py_compile benchmarking/data_prep/prepare_audio_tagging_data.py benchmarking/scripts/audio_tagging_benchmark.pypython3 benchmarking/data_prep/prepare_audio_tagging_data.py --help--raw-data-dir={dataset:audio_tagging_ami_sdm,files}, pass--no-auto-download, and no longer pass--input-manifestgit diff --checkEarlier full one-GPU PR validation, before the data-prep-only refactor:
The full GPU benchmark was not rerun after this data-prep refactor in the current local environment.
Checklist