Fix uninterpolated error messages in per-channel TensorQuantOverrides validation - #31696
Open
Nilesh Patil (nileshpatil6) wants to merge 1 commit into
Open
Conversation
… validation
The mismatch checks for quant_type, axis, symmetric and reduce_range in
TensorQuantOverridesHelper._is_valid_per_channel were missing the f prefix,
so the returned error string literally contained {tensor_name} and {index}
instead of the actual values. Added the missing f prefixes and a test that
exercises the symmetric mismatch case.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Reopens #29551, which Xavier Dupré (@xadupre) had already approved. I accidentally killed that PR by deleting my fork while cleaning up old repos, and GitHub won't let a PR reopen once the head repo is gone. Same commit, cherry-picked onto current main (clean, no conflicts).
For context from the original PR:
Four error messages in
TensorQuantOverridesHelper._is_valid_per_channelwere built as plain strings instead of f-strings, so users hitting per-channel validation errors saw literal{tensor_name}and{index}placeholders instead of the actual tensor and channel index. The fix adds the missingfprefixes and a regression test.Re-verified after the rebase: installed the published onnxruntime wheel, swapped in the patched
tensor_quant_overrides.py, and rantest_tensor_quant_overrides_option.py: 22 passed, 47 subtests passed. Also did the negative control again, against the unpatched wheel the new test fails with the literal placeholder message, with the patch it passes.The one failing check on the old PR (web_Debug / build_onnxruntime_web) was an unrelated WebGPU flake in the browser test suite, this change only touches the Python quantization tooling.