Skip to content

fix(stt): load quantized Qwen3-ASR audio layers - #4382

Merged
jundot merged 1 commit into
jundot:mainfrom
arnavprabhu:fix/qwen3-asr-audio-quantization
Oct 9, 2026
Merged

jundot merged 1 commit into
jundot:mainfrom
arnavprabhu:fix/qwen3-asr-audio-quantization

Conversation

@arnavprabhu

Copy link
Copy Markdown
Contributor

Summary

Qwen3-ASR skips all audio layers when loading quantized weights. This makes Alkd/TEA-ASR-1.1-MLX-4bit fail with a matmul shape error.

Let the shared mlx-audio loader check audio scales and per-layer settings. Add tests for mixed 4-bit text / 8-bit audio weights and floating-point audio layers.

Fixes #3573

Validation

Apple M5 Pro, 64 GB, macOS 27.0.1, Python 3.12.13.

  • Audio tests: python -m pytest tests/test_qwen3_asr_quantization.py tests/test_audio_stt.py tests/test_audio_discovery.py tests/test_audio_realtime.py -q — 156 passed.
  • Default suite: python -m pytest -n 3 --dist loadgroup — 17,282 passed, 628 skipped.
  • Regression check: both quantized-audio cases fail before the fix; both floating-point cases pass.
  • Black and Ruff pass for the helper and new tests.

Real-model check with Alkd/TEA-ASR-1.1-MLX-4bit: used macOS say to make a 16 kHz WAV of “The meeting starts at nine in the morning.” Before the fix, STTEngine.transcribe() fails with the reported (3,13,7680) vs (1920,1024) shape error. After the fix, the audio projection loads at 8 bits and returns “The meeting starts at 9 in the morning.” Used language="en", max_tokens=64.

Checklist

  • I read CONTRIBUTING.md.
  • I understand every change in this PR and can explain it in review.
  • No UI or UX changes.

@jundot jundot left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the stock Qwen3-ASR 8-bit checkpoint and it quantizes the exact same layers as before, since the audio tower still falls through to the scales check. So this only changes checkpoints that actually ship quantized audio weights. Merging.

@jundot
jundot merged commit add3ee1 into jundot:main Oct 9, 2026
1 check passed
jundot added a commit that referenced this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qwen3_asr STT fails when the audio tower is quantized via per-layer config overrides

2 participants