Add ASR fp16 recipe for MahmoudAshraf/mms-300m-1130-forced-aligner#1095
Open
ssss141414 wants to merge 3 commits into
Open
Add ASR fp16 recipe for MahmoudAshraf/mms-300m-1130-forced-aligner#1095ssss141414 wants to merge 3 commits into
ssss141414 wants to merge 3 commits into
Conversation
Standard Wav2Vec2ForCTC model. Stock 'winml build' auto-config loads ASR via AutoModelForSpeechSeq2Seq, which rejects Wav2Vec2Config and fails. This recipe forces model_class=AutoModelForCTC (via 'winml config --model-class'), making the model buildable. Validated on CPU: fp16 build exit 0 (250.6s), 426 FLOAT16/0 FLOAT32 inits, output logits[1,49,31] CTC frames, L1 perf P50 133.9ms.
…or all-10-bucket README)
Contributor
|
if without the config, could perf run it directly? |
Contributor
Author
As PR's description, it will failed on build stage without config. And the following command will not be run (perf/ eval)... |
Contributor
if it is the case, should we update the code to make it work? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ASR fp16 recipe:
MahmoudAshraf/mms-300m-1130-forced-aligner1. Model & task
MahmoudAshraf/mms-300m-1130-forced-aligner@ automatic-speech-recognition, fp16. A CTC forced-alignment model built onfacebook/mms-300m.2. What this PR adds
examples/recipes/MahmoudAshraf_mms-300m-1130-forced-aligner/automatic-speech-recognition_fp16_config.json(new recipe)examples/recipes/README.md(index row + total bump)Recipe-only. No source code changed (Effort-L0★).
3. Why it's needed (the engineering delta)
This is a standard
Wav2Vec2ForCTCmodel (architectures=["Wav2Vec2ForCTC"],vocab_size=31), not trust_remote_code. Butwinml buildauto-config resolvesautomatic-speech-recognitionto a seq2seq loader and fails:winml's ASR auto-loader assumes seq2seq (Whisper/SpeechT5/SeamlessM4T family), but wav2vec2 ASR is a CTC head (single encoder + linear projection), which must be loaded via
AutoModelForCTC. This recipe pinsloader.model_class = AutoModelForCTC(generated viawinml config --model-class AutoModelForCTC), making the model build.winml buildhas no--model-class/--taskflag, so a checked-in recipe is the only override.4. Real-engineering gate (
_meta-038)winml config -t automatic-speech-recognition --model-class AutoModelForCTCautoconf): IDENTICAL.Wav2Vec2Config).5. Build validation (CPU)
fp16 build exit 0 in 250.6 s (Export 93.9 + Optimize 42.9 + FP16 29.8). Final artifact 602 MB. fp16 confirmed: 426 FLOAT16 initializers, 0 FLOAT32.
6. Structural (L0)
IN
input_values [1,16000]float32 (1 s @ 16 kHz, value_range [-1,1]). OUTlogits [1,49,31]— 49 CTC frames × 31-token vocab (correct CTC alignment output; frame count scales with audio length).7. Perf (L1, CPU / CPUExecutionProvider)
mean 134.84 ms, P50 133.91 ms, P90 139.96 ms, throughput 7.42 samples/sec (20 iters).
8. Scope / honest limits
9. Output is frame logits, not text
The graph emits CTC frame logits
[1, T, 31]; CTC collapse / forced-alignment decoding happens downstream. Feature extraction (waveform →input_values) is also outside the graph.10. Requirements
Recipe pins
model_class=AutoModelForCTC; no--trust-remote-codeneeded (standard architecture).11. Testing done
fp16 build (exit 0), fp16 initializer dtype audit,
winml perfon CPU. Reproducible viawinml build -c <recipe> -m MahmoudAshraf/mms-300m-1130-forced-aligner.12. Follow-ups (out of scope here)
*ForCTC) needAutoModelForCTC. A future auto-detect of*ForCTCarchitectures would remove the need for this recipe override.