model(wav2vec2): support facebook mms 1b asr#1177
Draft
fuliucansheng wants to merge 1 commit into
Draft
Conversation
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.
Summary
Adds support for
facebook/mms-1b-allby routing Wav2Vec2 CTC ASR checkpoints throughAutoModelForCTCinstead of the ambiguous speech-seq2seq default, and adds a verified CPU fp32 automatic-speech-recognition recipe. Highest verified outcome on this host is L1 for CPU fp32: build, structural validation, analyze, and CPU perf all ran successfully.Model metadata
What the model does
facebook/mms-1b-allis a Wav2Vec2 CTC automatic speech recognition model. It consumes raw audio samples (input_values) and emits CTC logits over a 154-token vocabulary for speech transcription/language-token decoding.Primary user stories
Supported tasks
architectures=["Wav2Vec2ForCTC"];winml inspectresolves ASR; fp32 recipe builds and perfsModel architecture
Source/confidence: pinned checkpoint config and exported hierarchy metadata (
verified).Validation and support evidence
Baseline
26a4a82b638f2169b5a2f75758abb31a60b1774e0.2.0maindetected taskautomatic-speech-recognitionbut selected loaderAutoModelForSpeechSeq2Seq; this is incorrect forarchitectures=["Wav2Vec2ForCTC"].winml config -m facebook/mms-1b-allemittedloader.model_class: AutoModelForSpeechSeq2Seq,quant.mode: static,weight_type: uint8,activation_type: uint16.Goal
Outcome
src/winml/modelkit/models/hf/wav2vec2.py,src/winml/modelkit/models/hf/__init__.py.examples/recipes/facebook_mms-1b-all/cpu/cpu/automatic-speech-recognition_fp32_config.json.uv run pytest tests/unit/models/test_wav2vec2_mapping.py --tb=short --no-cov -m "not e2e and not npu and not gpu"-> 4 passed.uv run ruff check src/winml/modelkit/models/hf/wav2vec2.py tests/unit/models/test_wav2vec2_mapping.py-> all checks passed.Per-EP/device/precision results
CPU fp32 structural validation: ONNX IR 8, opset 17, input
input_values [1, 16000], outputlogits [1, 49, 154]. External data layout is valid:model.onnxandmodel.onnx.dataare in the same output directory.CPU fp16 failure evidence:
convert_float_to_float16called ONNX shape inference and failed withgoogle.protobuf.message.EncodeError: Failed to serialize protoon the 3.7GB model. The fp16 candidate recipe was removed from the final diff.Delta
Recipe-vs-auto-config changes:
/loader/model_classAutoModelForSpeechSeq2SeqAutoModelForCTC/quantnull/export/dynamotruefalseCode delta:
MODEL_CLASS_MAPPINGfor Wav2Vec2automatic-speech-recognition -> AutoModelForCTC.MODEL_CLASS_MAPPINGfor Wav2Vec2audio-classification -> AutoModelForAudioClassification.examples/recipes/README.mdis unchanged.Analyze summary
Static rule analysis completed with usable results and exited nonzero only because one requested EP had no rule data.
Component-level summary:
Op-level summary:
Reproduce commands