Skip to content

Add ASR fp16 recipe for MahmoudAshraf/mms-300m-1130-forced-aligner#1095

Open
ssss141414 wants to merge 3 commits into
mainfrom
shzhen/add-mms-forced-aligner
Open

Add ASR fp16 recipe for MahmoudAshraf/mms-300m-1130-forced-aligner#1095
ssss141414 wants to merge 3 commits into
mainfrom
shzhen/add-mms-forced-aligner

Conversation

@ssss141414

Copy link
Copy Markdown
Contributor

Add ASR fp16 recipe: MahmoudAshraf/mms-300m-1130-forced-aligner

1. Model & task

MahmoudAshraf/mms-300m-1130-forced-aligner @ automatic-speech-recognition, fp16. A CTC forced-alignment model built on facebook/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 Wav2Vec2ForCTC model (architectures=["Wav2Vec2ForCTC"], vocab_size=31), not trust_remote_code. But winml build auto-config resolves automatic-speech-recognition to a seq2seq loader and fails:

Error: Unrecognized configuration class Wav2Vec2Config for this kind of
AutoModel: AutoModelForSpeechSeq2Seq. Model type should be one of DiaConfig,
... SpeechEncoderDecoderConfig, ... WhisperConfig.

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 pins loader.model_class = AutoModelForCTC (generated via winml config --model-class AutoModelForCTC), making the model build. winml build has no --model-class/--task flag, so a checked-in recipe is the only override.

4. Real-engineering gate (_meta-038)

  • Gate-1 (recipe vs winml config -t automatic-speech-recognition --model-class AutoModelForCTC autoconf): IDENTICAL.
  • Gate-2 (build without recipe): FAILS (seq2seq loader rejects 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]). OUT logits [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

  • CPU-only. DML / QNN / OpenVINO / VitisAI / NvTensorRTRTX not validated (host availability). The README "all 10 buckets" bar is not independently verified here.
  • No L2 parity vs PyTorch (CTC logits/alignment comparison deferred).
  • No L3 eval (ASR default-dataset + WER metric not confirmed).

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-code needed (standard architecture).

11. Testing done

fp16 build (exit 0), fp16 initializer dtype audit, winml perf on CPU. Reproducible via winml build -c <recipe> -m MahmoudAshraf/mms-300m-1130-forced-aligner.

12. Follow-ups (out of scope here)

  • Non-CPU EP validation once hosts are available.
  • L2 CTC-alignment parity harness.
  • Skill-side note (separate Lane-A PR): winml's ASR auto-loader is seq2seq-only; CTC-family models (*ForCTC) need AutoModelForCTC. A future auto-detect of *ForCTC architectures would remove the need for this recipe override.

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.
@ssss141414 ssss141414 marked this pull request as ready for review July 13, 2026 12:22
@ssss141414 ssss141414 requested a review from a team as a code owner July 13, 2026 12:22
@xieofxie

Copy link
Copy Markdown
Contributor

if without the config, could perf run it directly?

@ssss141414

Copy link
Copy Markdown
Contributor Author

if without the config, could perf run it directly?

As PR's description, it will failed on build stage without config. And the following command will not be run (perf/ eval)...

This is a standard Wav2Vec2ForCTC model (architectures=["Wav2Vec2ForCTC"], vocab_size=31), not trust_remote_code. But winml build auto-config resolves automatic-speech-recognition to a seq2seq loader and fails:

Error: Unrecognized configuration class Wav2Vec2Config for this kind of
AutoModel: AutoModelForSpeechSeq2Seq. Model type should be one of DiaConfig,
... SpeechEncoderDecoderConfig, ... WhisperConfig.

@xieofxie

Copy link
Copy Markdown
Contributor

if without the config, could perf run it directly?

As PR's description, it will failed on build stage without config. And the following command will not be run (perf/ eval)...

This is a standard Wav2Vec2ForCTC model (architectures=["Wav2Vec2ForCTC"], vocab_size=31), not trust_remote_code. But winml build auto-config resolves automatic-speech-recognition to a seq2seq loader and fails:

Error: Unrecognized configuration class Wav2Vec2Config for this kind of
AutoModel: AutoModelForSpeechSeq2Seq. Model type should be one of DiaConfig,
... SpeechEncoderDecoderConfig, ... WhisperConfig.

if it is the case, should we update the code to make it work?

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.

2 participants