add support for whisper models in OnnxDiscrepancyCheck#2565
Conversation
|
@copilot fix lint issues and reimport issues |
Fixed all lint issues in commit
|
…into xadupre/whisper
|
@copilot the linter still complains |
There was a problem hiding this comment.
Pull request overview
This PR extends OnnxDiscrepancyCheck to support encoder–decoder speech models (notably Whisper) by routing them through an audio-based transformers-vs-ONNX Runtime GenAI generation comparison, and adds supporting Hugging Face test-model utilities to keep test/reference architectures consistent.
Changes:
- Add Whisper/speech generation comparison path to
OnnxDiscrepancyCheck, including GenAI config output-name reconciliation for common Whisper builder/version mismatches. - Improve HF test-model creation to (a) reduce encoder/decoder layer counts consistently and (b) prefer
config.architectureswhen selecting the model class in--testmode. - Add unit tests covering the new speech/Whisper helpers and the HF utils behavior; loosen one brittle error-message assertion in an ONNX pass test.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
olive/passes/onnx/discrepancy_check.py |
Adds speech seq2seq detection and an audio-based generation comparison path, plus GenAI Whisper output-name reconciliation. |
olive/common/hf/utils.py |
Adds get_model_class_from_config, improves test-model layer reduction for encoder–decoder configs, and persists processors when present. |
test/passes/onnx/test_discrepancy_check.py |
Adds unit tests for the new GenAI output reconciliation helpers and the Whisper generation comparison path. |
test/common/test_hf.py |
Adds tests ensuring encoder/decoder layers are reduced consistently and that config-declared architectures are preferred in --test mode. |
test/passes/onnx/test_session_params_tuning.py |
Makes the assertion resilient to variant Torch error messages across versions/platforms. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Addressed in The remaining linter warnings were:
Validation:
|
|
@copilot fix lint |
Addressed in Fixes included:
Validation:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot fix lint |
Fixed in I reproduced the failing Lint workflow run (
|
Describe your changes
OnnxDiscrepancyCheck only supports text models