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

Abierto
#3,566 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
505
Forks
81
Merge medio
14 h 2 min
PR fusionados (30 d)
448

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lablup/mlxcel

Todos los issues de lablup/mlxcel

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.