Repository navigation
Conversation
|
Hi @tlopex, could you take a look at these Relax/ONNX schema default and attribute fixes when you have a chance? Please let me know if any further changes are needed. Thanks! |
|
Could one of you take a look at these ONNX schema-default and attribute correctness fixes when you have a chance, or point me to the right reviewer? I am keen to help get these fixes into TVM and happy to address feedback, add further regression tests, rebase, or split the changes if that would make review easier. The GitHub Actions checks also seem to need maintainer help with fork-workflow approval or a restart. I would appreciate any guidance on getting the appropriate checks running. Thank you for your time! |
|
The five Jenkins checks passed on this head. Could someone take a look at the ONNX schema defaults and attribute fixes when they have a chance? |
There was a problem hiding this comment.
🟡 Changes recommended
Critical correctness bugs remain in output_shape padding and zero-threshold NMS, causing shifted output values and incorrect suppression of disjoint boxes.
3 open issues
What changed in this PR
Aligns Relax’s ONNX importer with ONNX schema defaults and attribute encodings, with value-level regression checks against ONNX Runtime.
Changes:
- Derives
ConvTransposepadding fromoutput_shape. - Defaults omitted NMS IoU thresholds to zero and enables zero-threshold processing in TOPI.
- Supports numeric
Constantattribute encodings and adds regression tests.
| File | Description |
|---|---|
tests/python/relax/test_frontend_onnx.py |
Adds numerical regressions and updates structural NMS expectations. |
python/tvm/topi/vision/nms.py |
Allows zero IoU thresholds into the shared suppression loop. |
python/tvm/relax/frontend/onnx/onnx_frontend.py |
Handles output shapes, NMS defaults, and numeric constant attributes. |
Review effort: Max
| elif auto_pad == "SAME_LOWER" or "pads" not in attr: | ||
| pads_begin = [value - value // 2 for value in total_padding] | ||
| else: | ||
| pads_begin = list(attr.get("pads", [0] * (2 * spatial_dims)))[:spatial_dims] |
| ) | ||
|
|
||
| with T.if_(tvm_tirx.tirx.all(iou_threshold > te.const(0), valid_count[i] > te.const(0))): | ||
| with T.if_(tvm_tirx.tirx.all(iou_threshold >= te.const(0), valid_count[i] > te.const(0))): |
| elif "value_floats" in attr: | ||
| np_value = _np.asarray(attr.pop("value_floats"), dtype="float32") |
Signed-off-by: Yuhx141 <155034285+Yuhx141@users.noreply.github.com>
Signed-off-by: Yuhx141 <155034285+Yuhx141@users.noreply.github.com>


This aligns three Relax ONNX import paths with the corresponding ONNX schemas:
ConvTranspose.output_shapeby deriving the required spatial padding;NonMaxSuppression, and allow zero in the shared TOPI NMS loop;Constant's numericvalue_float,value_floats,value_int, andvalue_intsencodings.Each change has a value-level regression against ONNX Runtime, in addition to the existing structural coverage.
Closes #20505
Closes #20506
Closes #20507
Tests:
pytest tests/python/relax/test_frontend_onnx.py -k "conv_transpose or nms or constant_value_attributes" -q(32 passed)