You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2026/06/26 22:24:35 UTC
[PR] [Relax][ONNX] Fix structural tests for TVMScript checks [tvm]
tlopex opened a new pull request, #19894:
URL: https://github.com/apache/tvm/pull/19894
This pr is the follow-up pr of #19880. This pr updates ONNX frontend structural tests to match the current Relax/TVMScript
semantics on main.
The previous expected IR still used `"void"` as the default dtype marker for ops such as matmul, cumsum, and zeros_like. After the Relax optional-dtype cleanup, those defaults should be represented by omitting the dtype argument, which makes CI crash
Also update the dynamic-shape squeeze structural check to build the expected Relax IR programmatically, because TVMScript currently cannot round-trip the SizeVar dataflow binding printed by the importer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Frontend][ONNX] Fix structural tests for TVMScript checks [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #19894:
URL: https://github.com/apache/tvm/pull/19894
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Frontend][ONNX] Fix structural tests for TVMScript checks [tvm]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19894:
URL: https://github.com/apache/tvm/pull/19894#discussion_r3484407688
##########
tests/python/relax/test_frontend_onnx.py:
##########
@@ -3934,21 +3928,16 @@ def test_dynamic_shape_squeeze(axis):
assert len(tvm_model["main"].attrs["params"]) == 1
tvm_model["main"] = tvm_model["main"].without_attr("params")
- @I.ir_module
- class Expected:
- @R.function
- def main(
- x: R.Tensor(("A",), dtype="float32"),
- axes: R.Tensor((1,), dtype="int64"),
- ) -> T.int64:
- A = T.int64(is_size_var=True)
- R.func_attr({"num_input": 1})
- with R.dataflow():
- gv: T.int64 = R.prim_value(A)
- R.output(gv)
- return gv
-
- tvm.ir.assert_structural_equal(tvm_model, Expected)
+ # TVMScript cannot currently round-trip this SizeVar dataflow binding.
+ a = tvm.tirx.SizeVar("A", "int64")
+ x = relax.Var("x", relax.TensorType([a], "float32"))
+ axes = relax.Var("axes", relax.TensorType([1], "int64"))
Review Comment:

There are two issues here that will cause the test to crash at runtime:
1. `tvm.tirx` is not a valid module. It should be `tvm.tir.SizeVar`.
2. `relax.TensorType` represents the type of a tensor (which only has `ndim` and `dtype` as parameters) and cannot be constructed with a shape list like `[a]` or `[1]`. Instead, use `relax.TensorStructInfo` to specify the shape and data type of the variables.
```suggestion
a = tvm.tir.SizeVar("A", "int64")
x = relax.Var("x", relax.TensorStructInfo([a], "float32"))
axes = relax.Var("axes", relax.TensorStructInfo([1], "int64"))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org