Fix test_mnb_to_qdq for ORT versions that fixed the int4→uint8 DQ bug#2595
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@copilot i think the latest version of onnxruntime does not crash anymore so this test should conditioned to the fact onnxruntime version is older than a specific reason |
Done in 2d? — the
Correction on the commit reference above: this is addressed in 59cdbf9. |
There was a problem hiding this comment.
Pull request overview
This PR updates Olive’s ONNX pass test suite to handle an ONNX Runtime (ORT) behavior change: newer ORT builds no longer hit the legacy int4→uint8 dequantization rewrite that previously caused test_mnb_to_qdq to fail while loading the generated model.
Changes:
- Added an ORT-version flag (
INT4_DQ_UINT8_BUG) documenting and gating the legacy int4 DQ → uint8 DQ optimization issue. - Updated
test_mnb_to_qdqto only expect the"uint8"load failure on ORT versions believed to still have the bug, allowing newer ORT versions to proceed to output validation.
|
@copilot fix lint issues and fast tests |
|
@copilot SUBFAILED(model_id='local/tiny-random-llama-a') test/cli/test_cli_test_model_smoke.py::TestCliTestModelSmoke::test_documented_test_model_smoke_flow - AssertionError: assert False
|
Fixed in 55ed28e. The fast-test failure was caused by two runtime compatibility gaps: the model builder now needs |
|
@copilot _ TestCliTestModelSmoke.test_model_discrepancy (model_id='Qwen/Qwen2.5-VL-7B-Instruct', exporter='model_builder') _ |
|
fixed in another PR |
Describe your changes
test_mnb_to_qdqhard-asserted that ORT raises a"uint8"exception for thesymmetric + signed_int + no_zero_point + transpose_opcase, a workaround for an old ORT graph-optimization bug that rewrote int4 DQ nodes to uint8. Newer ORT builds fixed that bug, so the session now loads successfully andpytest.raises(Exception, match="uint8")fails withDID NOT RAISE.pytest.raiseswith atry/exceptthat skips remaining validation only if the legacy"uint8"error still occurs (old ORT), re-raises anything unexpected, and otherwise proceeds to the normal output-correctness checks (fixed ORT).Test-only change; no production code affected.
Checklist before requesting a review
lintrunner -a(Optional) Issue link