qwen3-asr: replace encoder with chunked block-attention export
Browse filesThe previous encoder ran unmasked global self-attention over the
zero-padded mel input — padding-derived tokens contaminated real
audio embeddings and triggered the text decoder to emit <|im_end|>
right after the first sentence-final period. WER on LibriSpeech
test-clean: 24.88%.
The new encoder mirrors upstream Qwen3OmniMoeAudioEncoder's chunked
block attention (100-frame chunks -> 13 tokens, 800-frame attention
windows via cu_seqlens). Switches to a single fixed [1, 128, 3000]
mel shape (drops EnumeratedShapes) and adds a mel_length int32
input + output_length int32 output so consumers can slice to the
real un-padded audio-token count.
New interface:
inputs: mel [1, 128, 3000] float32, mel_length [1] int32
outputs: audio_embeddings [1, 390, 1024] float16,
output_length [1] int32
LibriSpeech test-clean n=200 (Apple M5 Pro, INT8 palettized):
WER 24.88% -> 3.02% (matches MLX 0.6B 4-bit baseline 2.20%).
Encoder is also ~4.7x faster (24ms vs 113ms per call).
Compiled encoder.mlmodelc + uncompiled encoder_int8.mlpackage
replaced; new encoder_fp16.mlpackage added as a higher-precision
variant. Decoder + embedding + decoder config unchanged.
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:682e5417c7509fb7b843e50db1a2a1ee6f6320398b87a2d931e359fa27d1635d
|
| 3 |
+
size 372275
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e935d3ce19a529ef560b2e3be4c0180a571e74975f7db80d91ad13226748d250
|
| 3 |
+
size 186844416
|
|
@@ -1,18 +1,18 @@
|
|
| 1 |
{
|
| 2 |
"fileFormatVersion": "1.0.0",
|
| 3 |
"itemInfoEntries": {
|
| 4 |
-
"
|
| 5 |
"author": "com.apple.CoreML",
|
| 6 |
"description": "CoreML Model Specification",
|
| 7 |
"name": "model.mlmodel",
|
| 8 |
"path": "com.apple.CoreML/model.mlmodel"
|
| 9 |
},
|
| 10 |
-
"
|
| 11 |
"author": "com.apple.CoreML",
|
| 12 |
"description": "CoreML Model Weights",
|
| 13 |
"name": "weights",
|
| 14 |
"path": "com.apple.CoreML/weights"
|
| 15 |
}
|
| 16 |
},
|
| 17 |
-
"rootModelIdentifier": "
|
| 18 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"fileFormatVersion": "1.0.0",
|
| 3 |
"itemInfoEntries": {
|
| 4 |
+
"3CBD87CF-CD11-4101-AF72-A78BA9FA260B": {
|
| 5 |
"author": "com.apple.CoreML",
|
| 6 |
"description": "CoreML Model Specification",
|
| 7 |
"name": "model.mlmodel",
|
| 8 |
"path": "com.apple.CoreML/model.mlmodel"
|
| 9 |
},
|
| 10 |
+
"D2259FD6-72DD-4C12-B80A-ECB35B014416": {
|
| 11 |
"author": "com.apple.CoreML",
|
| 12 |
"description": "CoreML Model Weights",
|
| 13 |
"name": "weights",
|
| 14 |
"path": "com.apple.CoreML/weights"
|
| 15 |
}
|
| 16 |
},
|
| 17 |
+
"rootModelIdentifier": "3CBD87CF-CD11-4101-AF72-A78BA9FA260B"
|
| 18 |
}
|