feat(eval): add audio classification evaluation and MMS language ID recipes - #1389
Draft
ssss141414 wants to merge 1 commit into
Draft
ssss141414 wants to merge 1 commit into
ssss141414 wants to merge 1 commit into
Conversation
Contributor
Author
|
APPROVE Independent Reviewer verdict for
Coverage: full. Reachable verified tuples: CPU/cpu fp32 and CPU/cpu fp16. Deferred tuples: none. No blocking findings. Keep the PR draft. Do not merge, ready, relabel, retire, or start a later model as part of this review. |
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
This contribution adds generalized
audio-classificationevaluator, configuration, CLI, and schema support and refreshes CPU FP32/FP16 recipes forfacebook/mms-lid-256. The L2 outcome is independently mergeable and uses model metadata plus explicit label mappings rather than Model12 recipes, checkpoint hardcoding, or README changes. Goal L3 passed on candidate2e0516d378111677492758aa522ff8135b13a990; its two-row result is functional-smoke evidence only and reports 0 accuracy and 0 macro-F1, not model-quality success.Model metadata
What the model does
facebook/mms-lid-256is a 256-class spoken-language identification model. It accepts mono 16 kHz raw speech waveform samples and returns one logits vector whose argmax maps to an ISO 639-3 language code.edc73fd00996e671dfc59d16436a29b12b10588a;architectures=Wav2Vec2ForSequenceClassification, a 256-entryid2label, andsampling_rate=16000(verified).Primary user stories
verifiedfrom the pinned model card and audio-classification pipeline tag).mappedfrom the pinned language-identification task, 256 ISO 639-3 outputs, and fixed WinML waveform contract).Supported tasks
audio-classificationacross the checkpoint, Transformers, Optimum ONNX, and WinML surfaces. The Hub pipeline tag,Wav2Vec2ForSequenceClassification, Optimum vendor registry, and WinML inspect resolution toAutoModelForAudioClassificationplusWav2Vec2OnnxConfigagree (verified). Optimum already registers Wav2Vec2 audio classification; WinML adds no vendor-registry alias.Model architecture
input_values[1,16000] -> logits[1,256]ONNX contract (verified).Validation and support evidence
Baseline
Baseline was
maincommit8d631f6f1e5db26a04e8c13045280408c6f984dcwith WinML 0.3.0. Inspect and auto-config resolved Wav2Vec2audio-classification; recipe-free CPU FP32 build passed in 428.1 s with static FP32input_values[1,16000] -> logits[1,256]. A bounded three-iteration CPU run measured 312.12 ms mean, 311.27 ms p50, 3.20 samples/s, and +111.5 MB RAM. Pinned PyTorch/ONNX parity passed at cosine0.9999999999859412, max absolute error3.8623809814453125e-05, and matching top-196/nno. Eval was CLI-blocked before dataset loading becauseaudio-classificationwas not registered. Baseline Analyze produced a complete 2,001-op/15-type report with partial static support semantics and exit 1.The baseline was reused because the prior and current
mainSHAs were identical, so the reviewed diff was empty and no dependency surface changed. Optimum's vendor registry already listedaudio-classification,audio-frame-classification,audio-xvector,automatic-speech-recognition, andfeature-extraction; WinML added no registry entries.Goal
Outcome
The highest reached verdict is L3 PASS-FUNCTIONAL-SMOKE with full planned CPU FP32/FP16 coverage and no deferred tuples. The Lane B delta contains two refreshed MMS-LID recipes, generalized evaluator/config/CLI/schema support, and regression tests. Findings
wav2vec2-023throughwav2vec2-026and methodology finding_meta-116are separate Lane A work in gim-home/ModelKitArtifacts#308, head2d581008e92af2dea2664b69060fb78b6338feb7; no skill or knowledge file is in thiswinml-clidelta.This branch is based directly on
main, not stacked on Model12 PR microsoft/winml-cli#1388. That PR is currently draft and unmerged, and both branches independently carry compatible generalized audio-classification support. This contribution requires neither Model12 recipes nor fixtures and can merge independently. The overlapping shared evaluator changes will need normal conflict resolution or deduplication according to merge order; if #1388 merges before this review, this branch must be rebased onto updatedmain, duplicate shared changes dropped, and impacted validation rerun before merge.Per-EP/device/precision results and Functional smoke Eval
Each L1 row used a fresh child process, the same deterministic
[1,16000]waveform, 2 warmups, and 5 measured iterations. Exact RSS snapshots were FP32 49,852,416 before load, 3,866,636,288 after load, and 3,983,691,776 after warmup/measurement; FP16 was 49,934,336, 3,957,334,016, and 4,003,487,744 bytes respectively. FP16 was slower and used slightly more process RSS in this short CPU run; no speed or memory-improvement threshold applies.L0 structural validation. FP32 is exactly 3,864,865,108 bytes with 908 FLOAT initializers. FP16 is exactly 1,932,787,081 bytes with 908 FLOAT16 initializers while preserving FP32 graph/runtime I/O. Both have static
input_values[1,16000] -> logits[1,256], finite output, and top-196/nno. Both use ONNX external data; the large-model FP16 conversion logged that shape inference could not serialize the external-data model and completed through the explicit shape-inference-disabled fallback.L2 numerical parity. The deterministic one-second, 16,000-sample FLEURS waveform produced PyTorch logits
[1,256]. FP32 passed with cosine0.9999999999983611, max absolute error1.0102987e-05, and matching PyTorch/ONNX top-196/nno. FP16 passed with cosine0.9999992021219782, max absolute error0.0077041388, and matching top-196/nno.Functional smoke Eval. Candidate
2e0516d378111677492758aa522ff8135b13a990passed using FP32 ONNX Runtime CPU and pinnedgoogle/fleurs@70bb2e84b976b7e960aa89f1c648e09c59f894dd, configde_de, splittest, streaming with no shuffle. The authoritative label bridge was exactly FLEURS17/de_de/German -> 55/deu; no locale inference was used. Exactly 2 samples were requested, eligible, selected, decoded, and processed, producing 2 total inference windows. Both utterances were truncated to one second / 16,000 samples and capped at one window each. Targets weredeu,deu; predictions werecym,nno; accuracy was 0.0 and macro-F1 was 0.0. This is emphatically a bounded functional smoke proving evaluator and model-path operability only. It is non-representative and is not evidence of benchmark quality or model-quality success.The former blocker was the absence of an
audio-classificationEval task. The generalized evaluator now supplies explicit dataset/schema configuration, SoundFile raw-audio decoding, mono/resampling and static-window preprocessing, exact configurable labels, utterance-level mean-logit aggregation, prediction decoding, accounting, accuracy, and macro-F1.Quality evidence. Focused tests: 39 passed, 1 warning. Eval/recipe regressions: 704 passed, 1 warning. Analyze: 1529 passed, 45 skipped. Models/loader/datasets/export: 1541 passed, 7 skipped, 1 xfailed. Optim: 876 passed, 16 skipped, 1 xfailed. Commands/config/build/compiler/session/eval: 3727 passed, 9 skipped, 2 warnings. Mypy was clean on 441 source files at the baseline and 442 source files on the candidate. Touched Ruff, recipe JSON/schema validation, and checkpoint/dataset license checks passed.
The disjoint remaining partition must retain its raw result as FAIL:
6 failed, 2536 passed, 9 skipped, 1 xfailed, 1 warning. Tester reran the exact six selectors against parent and candidate with the same interpreter/environment and reproduced all six identically, so candidate-delta grading isPASS-WITH-SIX-BASELINE-EXCLUSIONS; the raw run is not relabeled as passing:test_no_direct_ep_device_imports_in_src: identical existingexport/policy.pydirect-import policy violation.test_no_inline_ep_device_mapping_literals_in_src: identical existingperf.pyandopenvino_monitor.pyinline mappings.test_demo_locks_server_selection_to_document_origin: identical host failure because Node could not be resolved.test_demo_preserves_mount_path_in_server_url: identical host failure because Node could not be resolved.test_uv_lock_does_not_include_cuda_accelerator_packages: identical checkout failure because both trees lackuv.lock.test_uv_lock_records_direct_project_dependencies: identical checkout failure because both trees lackuv.lock.Delta
The base-to-candidate range is
8d631f6f1e5db26a04e8c13045280408c6f984dc..2e0516d378111677492758aa522ff8135b13a990: 11 files, 2,163 insertions, and 3 deletions.examples/recipes/README.mdis untouched; no Model12 recipe, fixture, model ID, or dataset ID is hardcoded into production evaluator logic.examples/recipes/facebook_mms-lid-256/cpu/cpu/audio-classification_fp16_config.json/export/compatibility:null->{ "transformers_attention": "eager" }; relative to auto-config, adds/quantwithmode=fp16,fp16_keep_io_types=true, and the retained recipe quantization fields.examples/recipes/facebook_mms-lid-256/cpu/cpu/audio-classification_fp32_config.json/export/compatibility:null->{ "transformers_attention": "eager" }; otherwise identical to the Planner starting auto-config.src/winml/modelkit/commands/eval.pysrc/winml/modelkit/eval/__init__.pysrc/winml/modelkit/eval/audio_classification_evaluator.pysrc/winml/modelkit/eval/config.pyDatasetConfig.max_duration_secondsand label-mapping configuration.src/winml/modelkit/eval/evaluate.pyaudio-classificationevaluator dispatch.src/winml/modelkit/utils/eval_utils.pytests/unit/eval/test_audio_classification_evaluator.pytests/unit/eval/test_eval.pytests/unit/recipes/test_cpu_recipes.pyBug fix explanation.
winml eval --task audio-classificationfailed before dataset loading because the task had no registry/schema/evaluator path; valid streaming audio and external dataset labels therefore could not reach ONNX inference and task metrics.WinMLAudioClassificationEvaluator,_AudioModelAdapter,DatasetConfig.max_duration_seconds,_EVALUATOR_REGISTRY, andTASK_SCHEMASnow preserve/decode supported audio representations, normalize shape/rate, enforce static model contracts and caps, map labels explicitly, aggregate logits once per utterance, decode predictions, and emit accounting plus metrics.The class-wide evaluator fix is metadata/configuration-driven and recipe-free; the two recipes record exact checkpoint/precision compatibility. Reducibility is consistent with the L2 charter.
Analyze summary - component level and op level
Analyze completed with PASS-PARTIAL-COMPONENT-MAPPING and CLI exit 1 partial-support semantics. These are static rule and graph-name analyses, not runtime execution or accelerator support claims.
Component-level summary
Op-level summary
The supported rule rows each map all 1,875 operators. CUDA GPU, MIGraphX GPU, legacy TensorRT GPU, DML GPU, CPU, and VitisAI NPU had no loaded rule classifications; they are not runtime failures or support claims. FP16 component analysis has 1,877 graph nodes because of its two boundary Casts, while the tester-owned op-level rule report is the 1,875-op FP32 analyzed artifact.
Reproduce commands
The commands below normalize the tester invocations to repository-relative paths and portable variables. The checkout must be candidate
2e0516d378111677492758aa522ff8135b13a990, and$MODELmust resolve pinned checkpoint revisionedc73fd00996e671dfc59d16436a29b12b10588a.label-map.jsoncontains the exact FLEURS-to-model bridge{ "de_de": 55 }.Portable environment provenance: Windows, Python 3.11.15, PyArrow 23.0.1, Datasets 5.0.1, pytest 9.1.1, Ruff 0.16.5, mypy 2.3.1, Transformers 4.57.6, and ONNX Runtime 1.27.1. The test environment was a private dependency-compatible copy used to avoid TLS acquisition failure, with candidate source bound explicitly; no Model12 artifacts or results were reused.