Repository navigation
[Bugfix][Multimodal] Fix Qwen3-ASR audio preprocessing parity - #57146
DarkLight1337 merged 13 commits into
Conversation
|
Hi @DarkLight1337, I retained the bundled processor to preserve compatibility with Transformers 5.10.4 and existing checkpoints. Happy to switch to the upstream Transformers processor if requiring >=5.13 is preferred. |
|
Why didn't you use the |
Sure, we should remove the native ones, we only port them because of missing transfomers support at day0 |
Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>
a455f34 to
489f79d
Compare
| Qwen3OmniMoeThinkerMultiModalProcessor, | ||
| BaseMultiModalProcessor[Qwen3ASRProcessingInfo], | ||
| ): | ||
| def _call_hf_processor( |
There was a problem hiding this comment.
Please refactor this to use _get_hf_mm_text and _postprocess_hf_mm_data
There was a problem hiding this comment.
Thanks! Refactored text setup and output conversion into the requested hooks. Retained per-clip processing because HF batch padding changes audio features and would break cache independence. Added regression coverage and validated both checkpoint formats with Transformers 5.13 and 5.17.
Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>
| input_audio_features=torch.cat(features, dim=1), | ||
| feature_attention_mask=masks, | ||
| audio_feature_lengths=torch.stack([mask.sum() for mask in masks]), | ||
| audios = cast(list[AudioItem], hf_data["audio"]) |
There was a problem hiding this comment.
Don't assume that the "audio" key always exists. Take a look at how the other processors handle this
There was a problem hiding this comment.
Thanks. Updated this to follow the guarded audio lookup and list assertion used in MiDashengLMMultiModalProcessor. Missing or empty audio now skips extraction, and postprocessing leaves the data unchanged when input_features is absent.
Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>
Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>
|
/ci run --allow-stale |
|
✅ Triggered Buildkite CI #94152 for commit
|
|
/ci run |
|
✅ Triggered Buildkite CI #94153 for commit |
CI selector (shadow): 24 test steps (57 jobs) instead of 65 (97 jobs)Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works. Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.
Selector would run (24)
Would skip (today's rules run them) (45)
Would add (today's rules do not run them) (4)
AMD mirrors: would skip (43)
AMD mirrors: would add (2)
4 changed files · base |
|
/ci retry |
…roject#57146) Signed-off-by: MatthewCYM <chenyiming0v0@gmail.com>

Purpose
Fixes #56981.
Qwen3-ASR currently inherits Omni's waveform padding and forces a Whisper feature extractor, which can change audio features and placeholder counts relative to the checkpoint's upstream processor.
Following the review feedback, this revision:
Qwen3ASRProcessorand removes the bundled processor and its registration.BaseMultiModalProcessorwithout Omni's waveform padding.Both checkpoint formats remain supported: the original checkpoint declares
WhisperFeatureExtractor, while the native-hfcheckpoint declaresQwen3ASRFeatureExtractor.No shared Omni/VL implementation, model weights, encoder kernels, or speculative-decoding behavior is changed.
Test Plan
Validated against upstream main
528fa835fd37d0805a824d516e22f88df61a771awith Transformers 5.13.0 and 5.17.0.
.venv/bin/python -m pytest \ tests/models/multimodal/processing/test_qwen3_asr.py \ tests/models/multimodal/processing/test_qwen3_omni.py \ tests/multimodal/test_audio.py \ tests/models/multimodal/processing/test_common.py \ tests/model_executor/test_qwen3_asr_mrope.py \ tests/entrypoints/speech_to_text/transcription/test_qwen3_asr_sanitize_prompt.py \ tests/entrypoints/speech_to_text/transcription/test_transcription_inter_chunk_spacing.py \ -k 'not transformers and (Qwen3-ASR or test_qwen3_asr or test_qwen3_omni or test_audio.py or ForcedAligner or test_transcription_inter_chunk_spacing)' \ -qModel validation
Tested both
Qwen/Qwen3-ASR-0.6BandQwen/Qwen3-ASR-0.6B-hfwith both Transformers versions.Each run compared raw audio against independently computed upstream features in the same vLLM engine, using 32 LibriSpeech test-clean utterances plus 32 near-hop-boundary variants. Settings: single H100, BF16, greedy decoding, eager execution,
max_num_seqs=1, and processor/prefix caches disabled.All four model/version combinations matched prompt IDs and generated token IDs on 64/64 clips. Raw/reference WER was 2.8846% in every run. This is a bounded correctness evaluation, not a full-split accuracy or speed benchmark.
Environment: Python 3.13.15, PyTorch 2.13.0+cu130, and NumPy 2.4.6. Tests used this checkout's Python source with existing vLLM 0.29 CUDA extensions, not a fresh CUDA build. Full upstream CI remains necessary. Realtime and forced-aligner checks cover preprocessing, not complete streaming or timestamp-accuracy evaluation.
Related work and disclosure
This uses the processor hook introduced by #53610; that refactor does not implement this ASR preprocessing fix. #57076 addresses the separate post-expansion truncation issue.
AI assistance was used for implementation, investigation, and test preparation.