Skip to content

Commit af466ea

Browse files
ivanbasovclaude
andcommitted
fix(test): pin ONNX IR version 8 in ort quantize test
modelopt[onnx] pulls in onnxruntime-gpu~=1.22.0 as a dependency on all Python versions. Newer ONNX packages (1.19+) default model.ir_version to 12, but onnxruntime-gpu 1.22.0 only supports up to IR version 10, causing test_ort_quantize_int8_produces_output_file to fail on the GPU CI for py3.11, py3.12, and py3.13. Pin model.ir_version = 8 (the minimum required for opset 17) before saving the test model so the calibration InferenceSession succeeds with any onnxruntime version that supports IR ≤ 10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e24274c commit af466ea

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

code/tests/test_onnx_quant_workflow.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ def test_ort_quantize_int8_produces_output_file(self):
237237
node = oh.make_node("Gemm", inputs=["dets", "W", "B"], outputs=["Y"])
238238
graph = oh.make_graph([node], "tiny", [X], [Y], initializer=[W, B])
239239
model = oh.make_model(graph, opset_imports=[oh.make_opsetid("", 17)])
240+
# Pin to IR version 8 (opset-17 minimum). Newer ONNX packages default to
241+
# IR version 12, which onnxruntime-gpu 1.22.0 (a modelopt dependency) rejects.
242+
model.ir_version = 8
240243
onnx.checker.check_model(model)
241244

242245
calib = np.random.randint(0, 2, (8, 4), dtype=np.uint8)

0 commit comments

Comments
 (0)