Part Number: TDA4VM
Goodmorning,
I'm testing ONNXRuntime with support for C7x DSP released in the latest SDK v7.3.
I'm facing an issue with a model that works fine on standalone TIDL runtime, but fails during conversion using OnnxRuntime (with TIDL patch) in Python with the following error:
Traceback (most recent call last):
File "/home/ubuntu/OnnxRT.py", line 105, in setup_onnx_session
sess_options=session_options)
File "/home/ubuntu/texas/onnxrt_tidl/capi/onnxruntime_inference_collection.py", line 283, in __init__
self._create_inference_session(providers, provider_options)
File "/home/ubuntu/texas/onnxrt_tidl/capi/onnxruntime_inference_collection.py", line 315, in _create_inference_session
sess.initialize_session(providers, provider_options)
[libprotobuf FATAL /home/a0393754/work/7_03_00_03/protobuf-3.11.3/src/google/protobuf/repeated_field.h:1537] CHECK failed: (index) < (current_size_):
2021-05-14 15:37:53.380394760 [E:onnxruntime:, inference_session.cc:1311 operator()] Exception during initialization: CHECK failed: (index) < (current_size_):
I discovered that the error is triggered by a specific Add operator (the model contains 5 EltWise Adds, but only the last one triggers it), but I'm not able to understand why, since it seems like the other ones and if I convert the model with standalone TIDL ModelImport tool, it works fine.
Here you will find also the ONNX Session configuration I'm using:
required_options = {
"tidl_tools_path": <path_to_tidl_tool_dir>,
"artifacts_folder": <path_to_artifacts_dir>
}
optional_options = {
"platform": "J7",
"version": "7.3",
"tensor_bits": 8,
"debug_level": 1,
"max_num_subgraphs": 16,
"accuracy_level": 0,
"advanced_options:calibration_frames": 1,
"advanced_options:calibration_iterations": 3,
"advanced_options:quantization_scale_type": 1,
"advanced_options:high_resolution_optimization": 0,
"advanced_options:pre_batchnorm_fold": 0,
"ti_internal_nc_flag": 1601,
}
I was able to extract the operator in a standalone ONNX model, you can find it attached and it should allow you to reproduce the issue.
Is that problem linked to the operator itself (any unsupported parameters combination for example) or is there an issue in Onnx runtime? As said above, the model (and even the Add operator alone) are successfully converted by TIDL ImportTool.
If you need any other information or file, let me know.
Thanks in advance,
Federico