add: detect Q/DQ with int16/uint16 initializers for GPU Scale Transform Pass - #768
Closed
ankitm3k wants to merge 1 commit into
Closed
add: detect Q/DQ with int16/uint16 initializers for GPU Scale Transform Pass#768ankitm3k wants to merge 1 commit into
ankitm3k wants to merge 1 commit into
Conversation
Author
|
@mklimenk Please test, review & merge |
mklimenk
suggested changes
Aug 4, 2025
mklimenk
left a comment
There was a problem hiding this comment.
Please add tests to the IsQDQGraphWithUint16OrInt16() function to make sure that we cover all the cases.
Also please remove excessive comments, there's no need to be that explicit.
Comment on lines
+396
to
+405
| auto is_16bit_tensor = [](const onnxruntime::NodeArg* node_arg) -> bool { | ||
| if (!node_arg) return false; | ||
| const auto* type_proto = node_arg->TypeAsProto(); | ||
| if (type_proto && type_proto->has_tensor_type()) { | ||
| auto elem_type = type_proto->tensor_type().elem_type(); | ||
| return (elem_type == ONNX_NAMESPACE::TensorProto_DataType_UINT16 || | ||
| elem_type == ONNX_NAMESPACE::TensorProto_DataType_INT16); | ||
| } | ||
| return false; | ||
| }; |
There was a problem hiding this comment.
Please move it to a separate function, there's no need for long multi-line lambdas
Comment on lines
+427
to
+428
| // QuantizeLinear: [float_input, scale, zero_point] -> [quantized_output] | ||
| // The quantized output tensor determines the quantization type |
|
|
||
| // Zero point (index 2) must match quantized tensor type per ONNX spec | ||
| // It's optional - absent for INT32 and some float8 types | ||
| if (input_defs.size() >= 3 && is_16bit_tensor(input_defs[2])) { |
There was a problem hiding this comment.
Should it be output_defs[2]? It seems like the portion in the previous condition
Author
There was a problem hiding this comment.
yes its the zero_point dtype that is tested to check the INT16/UINT16 dtype
ankitm3k
force-pushed
the
ankit/gpu_qdq_changes
branch
from
August 4, 2025 15:50
fbf966a to
6ceb8e7
Compare
mklimenk
added a commit
to mklimenk/onnxruntime
that referenced
this pull request
Aug 21, 2025
sfatimar
pushed a commit
that referenced
this pull request
Aug 25, 2025
* Reintroduce #768 with a small fix * Fix model copying with help from microsoft#25761 * Remove unused debug variables
Author
|
Closing this PR as these changes got upstreamed in PR #784 |
vthaniel
pushed a commit
that referenced
this pull request
Aug 28, 2025
* Reintroduce #768 with a small fix * Fix model copying with help from microsoft#25761 * Remove unused debug variables
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.
Description
This PR enables the GPU Scale Transform Pass by detecting the UINT16 & INT16 Initializers type in the Q/DQ Nodes in the graph. This isolates the dependency on using the enable_qdq_optimizer provider option pass in the legacy OVEP code.