fix(audio): match mlx-vlm in the Nemotron-H Nano Omni STFT and subsampling biases

Open
#3,566 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust

Research direction

Read src/audio/nemotron_h_nano_omni/feature_extractor.rs, config.rs, and encoder.rs, then inspect the referenced mlx-vlm 0.8.1 audio implementation and existing tests. Update the extractor defaults and bias handling described in the issue, remove the d1-omni opt-in, and check the listed unit tests and d1-omni parity tests. Done means the real checkpoint’s log-mel features and first-token logits match the reference, with the max absolute difference recorded and the supported-models entry updated.

Written by the indexing model from the issue text.

Description

area:models modeltype:omni priority:medium status:ready type:bug

Problem

The Nemotron-H Nano Omni sound path does not compute what mlx-vlm computes on the same checkpoint. PR #3533 added the mlx-vlm form as an opt-in for d1-omni only and kept Nemotron on the old form, so Nemotron audio features and logits differ from the reference.

Current Behavior

  • src/audio/nemotron_h_nano_omni/feature_extractor.rs:150 with_mlx_audio_stft (symmetric Hann, 1 + (padded_len - n_fft) / hop frames) is called only by src/decision/d1_omni/audio.rs:222. The default in new uses a periodic window and padded_len / hop frames. mlx-vlm 0.8.1 nemotron_h_nano_omni/audio.py:474 calls hanning(win_length, periodic=False).
  • src/audio/nemotron_h_nano_omni/config.rs:133 subsampling_conv_bias defaults to false, so encoder.rs:248 never loads the subsampling biases. Upstream ParakeetEncoderSubsamplingConv2D uses nn.Conv2d with the default bias=True, and models/nemotron-3-nano-omni-30b-a3b-reasoning-4bit ships sound_encoder.encoder.subsampling.layers.{0,2,3,5,6}.bias.

Proposed Solution

Make the mlx-vlm form the only form: move the symmetric window and mlx-audio frame count into NemotronOmniFeatureExtractor::new, delete with_mlx_audio_stft and its d1-omni call, and make subsampling_conv_bias default to true (serde default and Default). A checkpoint missing a subsampling bias keeps failing with the existing copy_weight error. Callers already take the frame count from the extractor (src/server/model_worker.rs:3199, src/loading/vlm_nemotron_h_nano_omni.rs:484), so no placeholder formula changes.

Acceptance Criteria

  • Default extractor uses the symmetric window and mlx-audio frame count; one_second_tone_has_expected_frame_count and mlx_audio_stft_uses_a_symmetric_window_and_the_default_stays_periodic are updated to the new expectation
  • New failing test in encoder_tests.rs: NemotronOmniAudioConfig::default() and serde_json::from_str::<NemotronOmniAudioConfig>("{}") both have subsampling_conv_bias == true, and the synthetic encoder's output changes when its subsampling biases go from zero to nonzero (fails today because the default ignores them)
  • d1-omni parity tests in src/decision/d1_omni/audio_tests.rs still pass
  • Log-mel features and first-token logits match mlx-vlm 0.8.1 on models/nemotron-3-nano-omni-30b-a3b-reasoning-4bit for one real clip (record the max abs diff in the PR)
  • docs/supported-models.md Nemotron-H Nano Omni entry states the parity result

Verification

cargo test --lib audio::nemotron_h_nano_omni
cargo test --lib decision::d1_omni
cargo clippy --all-targets -- -D warnings

The real-checkpoint parity run uses the GPU and must go through gpu-lock run.

Dominant language
Rust
Stars
505
Forks
81
Avg merge
14h 2m
Merged PRs (30d)
448

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lablup/mlxcel

All issues in lablup/mlxcel

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.