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

Aperta
#3,566 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
505
Fork
81
Merge medio
14h 2m
PR unite (30g)
448

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lablup/mlxcel

Tutte le issue di lablup/mlxcel

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.