Skip to content

feat: support Qwen/Qwen3-Omni-30B-A3B-Instruct and Audiomcq dataset. - #2356

Merged
yuki-97 merged 23 commits into
NVIDIA-NeMo:mainfrom
yuekaizhang:audiomcq
Jun 9, 2026
Merged

yuki-97 merged 23 commits into
NVIDIA-NeMo:mainfrom
yuekaizhang:audiomcq

Conversation

@yuekaizhang

@yuekaizhang yuekaizhang commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Conditioned on NVIDIA-NeMo/Megatron-Bridge#3317

The PR adds support for the ICLR 2026 AudioMCQ datasets in nemo-rl and includes a qwen2.5-omni-7B and Qwen3-Omni audio grpo training YAML file using these datasets.

Training curve:

image

@yuki-97 I was wondering if you coule help review the PR when you have some time. Thanks.

yuekaizhang and others added 13 commits April 27, 2026 02:25
Both directories are local tool runtime state (Codex CLI cache and
Humanize plugin's per-session skill outputs) and should not be tracked
in the project tree. Required so /humanize:start-rlcr-loop's clean-tree
precondition is satisfied without committing tool state.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Yuekai Zhang <[email protected]>
Add a new built-in dataset wrapper AudioMCQDataset for the
Harland/AudioMCQ-StrongAC-GeminiCoT subset (already pre-filtered to
the StrongAC partition + Gemini-CoT high-quality subset; ships every
audio file inline next to a data.jsonl manifest), wire it into the
existing config-driven audio GRPO loader via DATASET_REGISTRY, and
extend vlm_hf_data_processor to recognize the new task name.

The loader uses snapshot_download with a cached lookup, applies a
defensive audio-contribution=='strong' guard for forward compatibility
even though the upstream dataset is already filtered, performs an
eager head-row asset probe at __init__ to fail fast before Ray actors
or vLLM/Megatron initialize, downmixes multi-channel audio to mono
before resampling to 16kHz with scipy.signal.resample_poly, and emits
the AVQA-shape multimodal message schema with the full-text answer
preserved (plus choices on the formatted sample for parity with MMAU).

Also add a standalone examples/configs/audio_grpo_7B_megatron.yaml
recipe targeting Qwen2.5-Omni-7B on a single node with 8 H100/H200
80GB GPUs (Megatron TP=4, vLLM TP=2), inheriting from the generic
grpo_math_1B_megatron.yaml base and redeclaring audio-specific
vLLM/Megatron/processor/env settings inline.

Tests cover registry plumbing, defensive strong-filter, deterministic
seeded shuffle + max_samples, eager-init missing-file failure,
format_data missing-file failure, message shape, and processor
acceptance using mocked snapshot fixtures (no network).

Docs: docs/guides/grpo-audio.md gains an AudioMCQ section describing
asset prerequisites, the 3B override-only switch path, and the new
7B recipe.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Yuekai Zhang <[email protected]>
Add the assertions Codex flagged as missing from AC-11:

- TestAudioMCQRegistry::test_load_response_dataset_round_trip — registry
  load via the public load_response_dataset entry point.
- TestAudioMCQRegistry::test_unsupported_dataset_name_raises — negative
  test for an unsupported dataset_name=audiomcq_strong alias.
- TestAudioMCQConstruction::test_max_samples_applied_after_defensive_filter
  — proves max_samples truncation runs AFTER the strong filter so weak
  rows cannot leak through when the truncation count is small.
- TestAudioMCQConstruction::test_validation_split_is_seed_reproducible
  — equal-seed split_validation_size produces identical train/val ID
  sets; different seeds produce different splits.
- TestAudioMCQFormatData::test_format_data_missing_file_raises_filenotfound
  — the FileNotFoundError message now must contain the resolved on-disk
  path, not just the source_dataset name.
- TestAudioMCQProcessor::test_vlm_hf_data_processor_returns_audiomcq_datum_spec
  — replace the previous lenient processor smoke with a real success-
  path assertion that vlm_hf_data_processor returns a DatumSpec whose
  task_name == "audiomcq", message_log is populated, and extra_env_info
  carries ground_truth + choices. Uses a minimal _FakeProcessor instead
  of a MagicMock so hasattr(processor, "conversation_preprocessor")
  evaluates to False.
- TestAudioMCQProcessor::test_dispatcher_rejects_unknown_task_name
  — direct verification of the existing 'No data processor' error path.

All 18 tests pass.

Signed-off-by: Yuekai Zhang <[email protected]>
Round 1 review #2 caught a real bug: split="validation" silently returned
training rows because the constructor unconditionally loaded
load_dataset(..., split="train") from the manifest and then called
split_train_validation, which only populated self.val_dataset on the
training instance. Any future YAML stanza with
data.validation.dataset_name=audiomcq would have evaluated on training
data.

The upstream Harland/AudioMCQ-StrongAC-GeminiCoT repo only ships a
native train manifest, so we synthesize validation from it. The split
arg now routes correctly:

- split="train" with split_validation_size=0: full filtered+shuffled
  set, no validation slice.
- split="train" with split_validation_size>0: train slice plus
  self.val_dataset for the train-and-validate-from-train convention.
- split="validation" with split_validation_size>0: returns the
  held-out slice as the dataset.
- split="validation" with split_validation_size=0: raises a clear
  ValueError instead of silently returning training data.

Add two regression tests:
- test_split_validation_returns_held_out_slice_not_train: proves
  split="validation" returns the same IDs as the train loader's
  val_dataset and is disjoint from the train slice.
- test_validation_split_requires_size: proves the no-size case raises
  a clear ValueError naming split_validation_size.

Signed-off-by: Yuekai Zhang <[email protected]>
… recipe

The first 7B-AudioMCQ smoke run aborted at policy init with:
  AssertionError: train_micro_batch_size != logprob_batch_size with TP>=4

The recipe sets megatron tensor_model_parallel_size=4, which triggers
NeMo-RL's known batch-variant accuracy guard for both DTensor and
Megatron backends. Per the doc URL the assertion prints, the cleanest
fix that keeps TP=4 is matching logprob_batch_size to
train_micro_batch_size (=1). Lowering TP would not buy us anything
correctness-wise and would cost memory headroom.

Signed-off-by: Yuekai Zhang <[email protected]>
The Harland/AudioMCQ-StrongAC-GeminiCoT dataset only ships a native train
manifest, so set both the train and validation entries to the same
audiomcq dataset with split_validation_size=0.026 and seed=42. After our
round-2 split-routing fix, this gives a deterministic 507-row held-out
slice that the validation loader returns directly while the train loader
keeps the remaining 18973 rows. Verified locally: the two loaders
produce identical val_ids and the train slice is disjoint.

Signed-off-by: Yuekai Zhang <[email protected]>
setup_response_data already collects validation rows from each train
wrapper's val_dataset (populated by split_train_validation when
split_validation_size>0) AND from the explicit data.validation entry.
The previous YAML configured both with split=audiomcq and identical
seed/size, which fed the same ~507 held-out rows into the validation
pool twice (live job 11365708 reported "Validation dataset loaded with
1014 samples", i.e. 2x507). Setting data.validation=null keeps a single
canonical source so future runs see the unique 507-row val slice.

Training is unaffected; the running job is left in place because
max_val_samples=32 caps the per-validation impact of the duplication.

Signed-off-by: Yuekai Zhang <[email protected]>
Restore the explicit `data.validation` block in the 7B audio recipe so
val size is configured next to the validation block (cleaner than
hiding it on `data.train.split_validation_size`). To make this work
without the duplication seen in job 11365708 (1014 = 2x507) AND
without train/val leakage, AudioMCQDataset gains a
`populate_val_dataset` flag (default True for backward compat):

- `populate_val_dataset=True` (current default): the train wrapper
  returns the train slice and exposes the held-out slice via
  self.val_dataset (the AVQA convention).
- `populate_val_dataset=False`: when an explicit data.validation block
  loads validation separately, the train wrapper still drops the
  held-out rows from self.dataset (no leakage) but leaves
  self.val_dataset unset (no double-counting).

Yaml now sets `populate_val_dataset: false` on train and a matching
`split_validation_size`/`seed` on the validation block. Two regression
tests cover the disjoint-train guarantee and the no-population
guarantee.

Signed-off-by: Yuekai Zhang <[email protected]>
- save_period 400 -> 50 (more frequent checkpoints)
- max_val_samples 32 -> 256, val_batch_size 32 -> 256
- val_at_start: true (sanity validation before any training step)
- drop the duplicate max_val_samples: 32 left over from the previous
  setting; YAML's last-key-wins masked it but the dead line was
  confusing

Signed-off-by: Yuekai Zhang <[email protected]>
Signed-off-by: Yuekai Zhang <[email protected]>
- Drop AVQA from the title; this is the unified Audio GRPO guide now.
- Lead with a recipe matrix (3B AVQA / 7B AudioMCQ-StrongAC-GeminiCoT)
  and clarify the pieces are independent so users can mix model sizes
  and datasets.
- Split into Datasets / Train / Convert / Evaluate / Results sections so
  the train -> convert -> eval flow reads top-to-bottom for either
  recipe. Keep the AVQA + R1-AQA reproduction details intact.
- Cite the AudioMCQ paper (https://arxiv.org/abs/2509.21060) and
  expand the StrongAC + Gemini-CoT filter description.
- Document the convert step's HF rate-limit workaround
  (HF_HUB_OFFLINE=1 / TRANSFORMERS_OFFLINE=1) and the 7B-specific eval
  override (vLLM tensor_parallel_size=2, gpus_per_node=2).
- Record the 7B step_50 MMAU sanity result (0.7250) as an early
  sanity-check number under Results.

Signed-off-by: Yuekai Zhang <[email protected]>
@yuekaizhang
yuekaizhang requested review from a team as code owners April 28, 2026 03:06
@copy-pr-bot

copy-pr-bot Bot commented Apr 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Apr 28, 2026
@yuekaizhang yuekaizhang changed the title feat: support Audiomcq dataset and qwen2.5-omni-7B yaml. feat: support Qwen/Qwen3-Omni-30B-A3B-Instruct and Audiomcq dataset. Apr 29, 2026
@yuekaizhang

Copy link
Copy Markdown
Contributor Author

Update: added Qwen/Qwen3-Omni-30B-A3B-Instruct audio grpo

AudioMCQ training curve:
image

@yuekaizhang
yuekaizhang marked this pull request as draft May 6, 2026 06:33
@yuekaizhang
yuekaizhang marked this pull request as ready for review May 12, 2026 02:50
yuekaizhang and others added 2 commits June 8, 2026 11:00
Add a 4n8g nightly test for the Qwen3-Omni-30B-A3B-Instruct AudioMCQ GRPO
recipe, mirroring the qwen2.5-omni avqa nightly. Trains 20 steps and checks
train/reward > 0.75 and validation/accuracy > 0.8.

- New recipe examples/configs/recipes/vlm/vlm_grpo-qwen3-omni-30ba3b-audiomcq-4n8g-megatron.v1.yaml
  (defaults to the audio_grpo_qwen3_omni_megatron.yaml exemplar, 20 steps).
- New driver tests/test_suites/vlm/vlm_grpo-qwen3-omni-30ba3b-audiomcq-4n8g-megatron.v1.sh
  (4 nodes x 8 GPU, NUM_MINUTES=60), registered in nightly.txt.
- Fix the exemplar recipe: set loss_fn.truncated_importance_sampling_type=tis.
  With the ratio set but the type left at the None default, the loss raises
  "Invalid truncated importance sampling type: None" at the first train step.
- Raise the nightly GPU-hour cap 1360 -> 1410 to fit the new 32 GPU-hr test
  (4n8g is the minimum hardware; 1n8g OOMs at the optimizer). New total 1377.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Yuekai Zhang <[email protected]>
@yuekaizhang
yuekaizhang requested a review from a team as a code owner June 8, 2026 05:27

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuekaizhang, thanks for adding this! left some comments.

Comment thread docs/guides/grpo-audio.md Resolved
yuekaizhang added a commit to yuekaizhang/RL that referenced this pull request Jun 8, 2026
Address yuki-97's review on PR NVIDIA-NeMo#2356:
- Simplify AudioMCQDataset to mirror avqa.py: drop populate_val_dataset
  and the split="validation" branch; synthesize the held-out validation
  slice via split_train_validation.
- Hold out an absolute 256-row validation slice (matches
  grpo.max_val_samples) instead of split_validation_size: 0.026, and drop
  the redundant data.validation block.
- Remove the dead vllm_cfg.limit_mm_per_prompt (30B) and move it to
  vllm_kwargs (7B); only **vllm_kwargs reaches vllm.LLM().
- Relocate the 7B and 30B audio configs into examples/configs/recipes/vlm/
  and delete the thin wrapper; add a Qwen2.5-Omni-7B 1n8g nightly and
  register both audio recipes in nightly.txt.
- docs: update recipe paths, dataset split description, and gotcha count.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Yuekai Zhang <[email protected]>
Address yuki-97's review on PR NVIDIA-NeMo#2356:
- Simplify AudioMCQDataset to mirror avqa.py: drop populate_val_dataset
  and the split="validation" branch; synthesize the held-out validation
  slice via split_train_validation.
- Hold out an absolute 256-row validation slice (matches
  grpo.max_val_samples) instead of split_validation_size: 0.026, and drop
  the redundant data.validation block.
- Remove the dead vllm_cfg.limit_mm_per_prompt (30B) and move it to
  vllm_kwargs (7B); only **vllm_kwargs reaches vllm.LLM().
- Relocate the 7B and 30B audio configs into examples/configs/recipes/vlm/
  and delete the thin wrapper; add a Qwen2.5-Omni-7B 1n8g nightly and
  register both audio recipes in nightly.txt.
- docs: update recipe paths, dataset split description, and gotcha count.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Yuekai Zhang <[email protected]>
@yuekaizhang yuekaizhang added the CI:L1 Run doctests, unit tests, and functional tests label Jun 9, 2026
@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test c16425d

1 similar comment
@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test c16425d

@yuki-97
yuki-97 enabled auto-merge (squash) June 9, 2026 06:52
yuki-97
yuki-97 previously approved these changes Jun 9, 2026

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @yuekaizhang

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 854d020

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 76633ea

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 76633ea

@yuki-97
yuki-97 merged commit 68065ad into NVIDIA-NeMo:main Jun 9, 2026
154 of 156 checks passed
pengdurice pushed a commit to pengdurice/RL that referenced this pull request Jun 12, 2026
@yuekaizhang
yuekaizhang deleted the audiomcq branch August 21, 2026 03:09

This branch was previously deployed

2 inactive deployments
public — 76633ea6 Deployed Jun 9, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #870
test — 76633ea6 Deployed Jun 9, 2026 by copy-pr-bot[bot] via Wait in test approval queue #12137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants