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

Đang mở
#3,566 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
505
Fork
81
Merge trung bình
14 giờ 2 phút
Pull request đã merge (30 ngày)
448

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lablup/mlxcel

Tất cả issue của lablup/mlxcel

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.