Repository navigation
Add LibriSpeech-PC benchmark, asr_with_pc resource server, and audio sidechannel in vllm_model - #1144
Merged
gwarmstrong merged 16 commits intoApr 28, 2026
Conversation
Migrates Skills' nemo_skills/dataset/librispeech-pc/ to Gym, with audio
base64-inlined into responses_create_params.input at prepare time
(circle_click pattern). Resource server lifts WER computation directly
from nemo_skills/evaluation/evaluator/audio.py::evaluate_asr_pc with
matching corpus-level aggregation in compute_metrics so headline numbers
align with Skills' AudioMetrics output.
Per-rollout: wer/wer_c/wer_pc/per/is_correct (wer_pc<0.5).
Corpus-level: corpus_wer{,_c,_pc}@k=N via jiwer.wer(refs, hyps).
Signed-off-by: gwarmstrong <[email protected]>
…sion with source _inherit_from with the same source/destination name was self-referencing, so the benchmark's resources_server reference 'librispeech_pc' couldn't be resolved (only librispeech_pc_resources_server existed in the merged config). Aime26 disambiguates by prefix; we use _bench_ since librispeech_pc the server name and librispeech_pc the benchmark name would otherwise collide. Signed-off-by: gwarmstrong <[email protected]>
BenchmarkDatasetConfig.prompt_config is Optional[Path] without a default, so the field must be present in the YAML (allowed value: null). The audio is already base64-baked into responses_create_params.input by prepare.py, so rollout-time prompt materialization is a no-op. Signed-off-by: gwarmstrong <[email protected]>
Skills' VLLMMultimodalModel.make_audio_content_block defaults to audio_format='audio_url' for self-hosted vLLM. Match that exactly so the content block byte-shape Gym sends to vLLM is identical to Skills'. Signed-off-by: gwarmstrong <[email protected]>
Option A unblock for audio benchmarks: openai's Responses-API content
union has no audio variant, so audio content blocks in
responses_create_params.input.content are rejected by simple_agent's
Pydantic validator before reaching the model server. vllm_audio_model
sidesteps this at the model layer:
- Audio data-URI rides on responses_create_params.metadata.audio_url
(Dict[str, str], opaque to the agent validator)
- vllm_audio_model._preprocess_chat_completion_create_params reads
metadata.audio_url, strips it, and prepends an audio_url block to
the most recent user message before forwarding to vLLM Chat Completions
Mirrors NeMo-Skills' VLLMMultimodalModel.content_text_to_list pattern.
prepare.py + example data generator updated to emit the sidechannel
shape. Once openai extends ResponseInputContentParam (or Gym adopts a
local extension — Option B), this wrapper can be deprecated.
Signed-off-by: gwarmstrong <[email protected]>
…gation Two parity fixes for the Skills↔Gym comparison: 1) prepare.py defaults to test-clean only (Skills' EVAL_SPLIT). Test-other can be added via --splits, but the default JSONL now matches what Skills' ns eval librispeech-pc:N processes. 2) compute_metrics aggregates wer_c, wer_pc, and per as mean-of-per-sample (matching nemo_skills/evaluation/metrics/audio_metrics.py:311-318), while keeping standard wer corpus-level (matching the same file's line 301-303). Previously all four were corpus-level, which produced ~20pp deltas vs Skills on wer_c and wer_pc despite identical per-sample values. get_key_metrics now exposes wer/wer_c/wer_pc/per under the Skills-aligned headline names. Signed-off-by: gwarmstrong <[email protected]>
Generated by ng_prepare_data (+mode=example_validation), ng_collect_rollouts, and ng_reward_profile against the resource servers example.jsonl with Qwen2-Audio-7B-Instruct on aws-iad. Mirrors the artifact set committed under other Gym resource servers (e.g. circle_click). Signed-off-by: George Armstrong <[email protected]>
The 'audio is base64-baked into responses_create_params.input' comment was true before the Option A pivot but is no longer accurate (audio now rides on metadata.audio_url, not in input.content). Remove rather than update — per migrate-benchmark §B2, YAML configs should be terse and let the README/skill carry the explanation. Signed-off-by: gwarmstrong <[email protected]>
…per-split datasets Three reusability/idiomaticity refactors landed together: 1. resources_servers/librispeech_pc -> resources_servers/asr_with_pc. The WER scoring infrastructure is generic across audio benchmarks (LibriSpeech-PC, asr-leaderboard, numb3rs, audiobench), so the server should name the verification method, not the benchmark — mirroring the math_with_judge / mcqa naming pattern. verify() now dispatches per-row on task_type (server-level default ASR-PC; ASR mode added for benchmarks that score standard WER only). 2. Built-in prompt_config. prepare.py emits raw rows without responses_create_params.input; benchmarks/librispeech_pc/prompts/default.yaml carries the system+user templates; prompt_config materializes them at rollout time. metadata.audio_url survives the materialization (apply_prompt_to_row preserves other responses_create_params fields) so vllm_audio_model still finds the audio sidechannel. 3. Per-split JSONLs. prepare.py writes librispeech_pc_test_clean.jsonl and librispeech_pc_test_other.jsonl separately. Benchmark config.yaml exposes two datasets entries (test_clean / test_other); ng_collect_rollouts +dataset_name=test_clean selects which split is used at rollout time. Recipe scripts + READMEs + example_data generator all updated to match. Tests: 25 -> 28 (added evaluate_asr + task_type dispatch coverage). Signed-off-by: gwarmstrong <[email protected]>
…requires 1) ng_prepare_benchmark asserts len(datasets) == 1 per agent. Reverted the two-datasets-per-agent design from the previous commit. test_other support is documented as a follow-up: either a sibling benchmark dir (idiomatic, mirrors aime24/aime25/aime26) or a custom config pointing at the librispeech_pc_test_other.jsonl that prepare.py --splits test-other emits. Signed-off-by: gwarmstrong <[email protected]>
…pare_benchmark contract Signed-off-by: gwarmstrong <[email protected]>
…ename Re-generated against the new responses_create_params.metadata.audio_url sidechannel shape (the prior copies still referenced resources_servers/librispeech_pc/data/...). Sub-1pp drift on the per-rollout WER aggregates and reward_profiling pass rates, well within Qwen2-Audio T=1.0 sample-to-sample variance. Signed-off-by: George Armstrong <[email protected]>
…lm_audio_model
Per upstream review feedback: a 30-line metadata-audio-url splice doesn't
need its own model type. Moved the splice (and its 6 unit tests) into
vllm_model._preprocess_chat_completion_create_params. The splice
short-circuits when responses_create_params.metadata.audio_url is absent,
so non-audio benchmarks see no behavior change.
Removed:
- responses_api_models/vllm_audio_model/ (the entire dir)
Updated:
- responses_api_models/vllm_model/app.py: splice logic appended to the
existing _preprocess_chat_completion_create_params override path.
- responses_api_models/vllm_model/tests/test_app.py: added
TestAudioSidechannelSplice with the 6 cases from vllm_audio_model.
- benchmarks/librispeech_pc/{config.yaml is unchanged} +
recipe scripts + Gym-side READMEs all reference vllm_model directly.
Signed-off-by: gwarmstrong <[email protected]>
Drops editorial/explanatory references to the upstream source repo (NeMo-Skills) and module paths from docstrings, comments, READMEs, and the test file. Keeps the technical content: WER definitions, aggregation rules, schema gotchas, and the metadata-sidechannel rationale all stand on their own. No functional change. Signed-off-by: gwarmstrong <[email protected]>
bxyu-nvidia
previously approved these changes
Apr 28, 2026
Matches the convention used by the other api_key='dummy_key' lines in this file (and across responses_api_models/) so detect-secrets stops flagging the new audio-splice test fixture. Signed-off-by: gwarmstrong <[email protected]>
bxyu-nvidia
approved these changes
Apr 28, 2026
gwarmstrong
enabled auto-merge (squash)
April 28, 2026 00:43
1 of 2 tasks
bxyu-nvidia
pushed a commit
that referenced
this pull request
May 8, 2026
## Summary - Adds the HuggingFace Open ASR Leaderboard (8 ESB subsets: librispeech-clean/other, voxpopuli, tedlium, gigaspeech, spgispeech, earnings22, ami) as a data-only benchmark. - Reuses the existing `asr_with_pc` resource server in `task_type=ASR` mode (Whisper-normalized WER, added in #1144) — no new server logic. - Audio is referenced via `responses_create_params.metadata.audio_path` (#1170) so the multi-GB FLAC corpus stays on disk instead of being inlined as base64 in every JSONL row. ## Why ASR-Leaderboard is the standard cross-domain WER benchmark suite for English ASR systems. Migrating it as data-only — no new server logic — extends Gym's audio coverage with zero verification risk. Both the prompt template (system + user messages) and the minimum-duration / empty-reference filtering match the upstream NeMo-Skills implementation exactly, so a data-only parity check (row count, `expected_answer`, audio path) is sufficient. ## Files - `benchmarks/asr_leaderboard/__init__.py` - `benchmarks/asr_leaderboard/config.yaml` — chains to `asr_with_pc.yaml` and pins `task_type: ASR`. - `benchmarks/asr_leaderboard/prepare.py` — downloads `hf-audio/esb-datasets-test-only-sorted`, saves FLACs to `<work_dir>/<dataset>/<id>.flac`, writes the combined `asr_leaderboard_benchmark.jsonl`. - `benchmarks/asr_leaderboard/prompts/default.yaml` — `"You are a helpful assistant. /no_think"` + `"Transcribe the following audio."` - `benchmarks/asr_leaderboard/README.md` - `benchmarks/asr_leaderboard/data/.gitignore` ## Test plan - [x] Smoke-tested `_format_row` and `_audio_filename` on synthetic dataset entries (empty-text skip, sub-0.1s skip, slash-in-id rewriting, AMI-style `id/name.suffix` stem extraction). - [ ] Skills-vs-Gym data-parity check (row count exact, `expected_answer` 100% agreement, audio paths 100% agreement) — runs in the migration recipe after merge once both prepare jobs have downloaded the corpus. --------- Signed-off-by: gwarmstrong <[email protected]> Co-authored-by: gwarmstrong <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add LibriSpeech-PC benchmark, asr_with_pc resource server, and audio sidechannel in vllm_model
Adds the LibriSpeech-PC ASR benchmark, a
generic
asr_with_pcresource server that scores Word Error Rate (full WER +WER_C + WER_PC + PER for ASR-PC; standard WER only for plain ASR), and a
small audio sidechannel inside
vllm_modelso audio benchmarks can carryaudio data over the Responses API.
The Responses API content union (
Union[ResponseInputTextParam, ResponseInputImageParam, ResponseInputFileParam]) has no audio variant —ResponseInputAudioParamexists in the openai SDK as an orphan type butisn't a member of any input union, so audio content blocks in
responses_create_params.input.contentare rejected bysimple_agent'sPydantic validator before reaching the model. The sidechannel rides over
responses_create_params.metadata.audio_url(Dict[str, str], opaque tothe validator);
vllm_model._preprocess_chat_completion_create_paramsstrips it and prepends an
audio_urlcontent block to the most recent usermessage before forwarding to vLLM Chat Completions, which natively accepts
audio content. The splice short-circuits when no
audio_urlis present, sonon-audio benchmarks see no behavior change.
Includes
responses_api_models/vllm_model/— audio sidechannel splice added tothe existing
vllm_modelno user message at all
resources_servers/asr_with_pc/— generic ASR / ASR-PC scoring server,reusable across audio-WER benchmarks
task_typeconfig dispatches per-row inverify()betweenASR-PC(full WER + WER_C + WER_PC + PER) and
ASR(Whisper-normalizedstandard WER only). Per-row override via the verify request body.
compute_metrics()aggregates non-uniformly: corpus-leveljiwer.wer(refs, hyps)for the headlinewer; mean-of-per-samplefor
wer_c,wer_pc,perbenchmarks/librispeech_pc/— benchmark config + prepare scriptis
test-clean(~2,417 utterances).prepare.pydownloads + base64-encodes the audio, writes one row perutterance with
responses_create_params.metadata.audio_urlcarryingthe data-URI.
responses_create_params.inputis left empty —prompt_configmaterializes the system+user messages at rollout timefrom
benchmarks/librispeech_pc/prompts/default.yaml.librispeech_pc_asr_with_pc_simple_agent→librispeech_pc_asr_with_pc_resources_server.Validated
Qwen/Qwen2-Audio-7B-Instruct, 4 seeds × 2,417 utterances, T=1.0 /top_p=0.95 / max_tokens=4096, on
test-clean. Reference numbers comefrom a parallel run that reads the same JSONLs but goes through a
different ASR scorer (one outside this PR);
(sample_id, expected_answer)pairs hash bit-identical between the two runs.
Implementation notes
Why fold the splice into
vllm_modelrather than a new model type.The audio sidechannel is ~30 lines and gates entirely on the presence
of
metadata.audio_url. Folding it into the existingvllm_modelavoids a parallel
vllm_audio_modeldirectory while keeping thepath-of-least-resistance for audio benchmarks.
Generic server name.
asr_with_pc(notlibrispeech_pc) so futureaudio-WER benchmarks (asr-leaderboard, numb3rs, audiobench) can
inherit from it. The
task_typedispatch lets benchmarks that scorestandard WER only (asr-leaderboard) reuse the server without a fork.