onnxruntime/onnxruntime/python
Yilun Huang 6ac7c894bf
[bug fixed] use different node names for different dedicated QDQ pairs (#14258)
### Description
<!-- Describe your changes. -->
Bug fixed: Quantized models cannot be loaded into ort.InferenceSession
when DedicatedQDQPair is True in extra_options of QDQQuantizer.
Solutions: Add postfix to node names of dedicated QDQ pairs similar to
tensor names of them.



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Loading quantized model fails when setting `DedicatedQDQPair` to `True`
in `extra_options` and raise an error as below:
```
Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from mobilenetv2-opset10-quantized-dedicated.onnx failed:This is an invalid model. Error: two nodes with same node name (489_QuantizeLinear).
```
After visualizing the quantized model using netron, we can find that
both the dedicated QDQ pairs for tensor 489 have the same node names of
"489_QuantizeLinear". So I found that in QDQQuantizer, there is no
unique postfix for the node names of dedicated QDQ pairs.
<img width="1171" alt="image"
src="https://user-images.githubusercontent.com/12782861/212010296-f8cc05ce-c20e-4189-a692-aaf4bbac3a29.png">


Therefore, I add postfix to node names of QDQ pairs similar to doing so
to tensor names. After this modification, the quantized model can be
loaded successfully and dedicated QDQ pairs have different node names.👌🏻
<img width="1037" alt="image"
src="https://user-images.githubusercontent.com/12782861/212010594-78eba39d-eab6-4d77-9ecd-b55f5303bcf4.png">
2023-01-13 11:24:54 -08:00
..
backend replace 'master' branch ref to 'main' for onnx repo (#12678) 2022-08-30 13:41:42 -07:00
datasets
providers/tvm Format all python files under onnxruntime with black and isort (#11324) 2022-04-26 09:35:16 -07:00
tools [bug fixed] use different node names for different dedicated QDQ pairs (#14258) 2023-01-13 11:24:54 -08:00
torch_cpp_extensions [ORTModule] ATen Support for aten::upsample_nearest (#13364) 2022-10-20 08:30:04 +08:00
training
__init__.py
_ld_preload.py Fix python manylinux to not load cuda if it fails to load dependencies (#8882) 2021-09-07 11:09:25 -07:00
_pybind_state.py.in Make ORT callable from various Pytorch compilers (LazyTensor, TorchDynamo, etc) (#10460) 2022-08-22 09:40:40 -07:00
exported_symbols.lst
numpy_helper.h Fix SDL warnings in CPU EP (#9975) 2021-12-19 20:54:29 -08:00
onnxruntime_collect_build_info.py Format all python files under onnxruntime with black and isort (#11324) 2022-04-26 09:35:16 -07:00
onnxruntime_inference_collection.py Enable ORT in TorchDynamo (#13259) 2022-11-01 11:19:29 -07:00
onnxruntime_pybind.h fix windows ci debug build break (#11495) 2022-05-12 16:54:00 -07:00
onnxruntime_pybind_exceptions.cc Python bindings fix ups in preparation to Sparse Tensor introduction (#7817) 2021-05-26 09:47:41 -07:00
onnxruntime_pybind_exceptions.h Fix issue with debug VS2022 build when python bindings are enabled (#9794) 2021-11-18 16:58:02 +10:00
onnxruntime_pybind_iobinding.cc Adds missing numpy type when looking for the ort correspondance (#10943) 2022-03-22 14:44:48 -07:00
onnxruntime_pybind_mlvalue.cc Multi-stream execution support (#13495) 2022-12-15 07:39:29 -08:00
onnxruntime_pybind_mlvalue.h Move OrtValueVector from onnxruntime-training to onnxruntime (#11176) 2022-06-15 09:36:28 +02:00
onnxruntime_pybind_module.cc Fix issue with debug VS2022 build when python bindings are enabled (#9794) 2021-11-18 16:58:02 +10:00
onnxruntime_pybind_ortvalue.cc Enable ORT in TorchDynamo (#13259) 2022-11-01 11:19:29 -07:00
onnxruntime_pybind_schema.cc Pass SessionOptions to XnnpackProviderFactoryCreator. (#13318) 2022-12-10 14:23:46 +08:00
onnxruntime_pybind_sparse_tensor.cc Multi-stream execution support (#13495) 2022-12-15 07:39:29 -08:00
onnxruntime_pybind_state.cc Rename CloudEP to AzureEP (#14175) 2023-01-11 12:25:04 -08:00
onnxruntime_pybind_state.h Fix issue with debug VS2022 build when python bindings are enabled (#9794) 2021-11-18 16:58:02 +10:00
onnxruntime_pybind_state_common.cc Allow CUDA EP enable or disable TunableOp via session options and environment variable (#13601) 2022-11-15 14:43:54 +08:00
onnxruntime_pybind_state_common.h Improve custom op library handle cleanup (#14099) 2023-01-04 17:56:29 -08:00
onnxruntime_validation.py Format all python files under onnxruntime with black and isort (#11324) 2022-04-26 09:35:16 -07:00
pybind.def
version_script.lds
version_script_expose_onnx_protobuf.lds Support external custom operator schemas on Ubuntu (#8807) 2021-08-28 11:05:21 -07:00