mvanhorn opened a new pull request, #19672: URL: https://github.com/apache/tvm/pull/19672
## Summary ONNX models with a `ConvTranspose` node that carries a bias now import through the Relax frontend instead of failing on a broadcast check, matching the output ONNX Runtime produces. ## Why this matters Issue [#18600](https://github.com/apache/tvm/issues/18600) reports `InternalError: ... relax.add ... dim 1 is 16 and ... 32, which are not broadcastable` when importing a ConvTranspose model that runs fine under ONNX Runtime and onnx's ReferenceEvaluator. The converter derived output channels from `weight.shape[0]`, but for ConvTranspose the weight layout is `(in_channels, out_channels/groups, *kernel)`, so true output channels are `weight.shape[1] * groups`. The 16-length bias was then broadcast against a wrong 32-channel shape. ## Testing The `ConvTranspose` converter in `python/tvm/relax/frontend/onnx/onnx_frontend.py` now computes `out_channels = weight.shape[1] * groups`, reshapes the bias to `[1, out_channels, 1, ...]`, and raises a clear `ValueError` when a static bias length genuinely mismatches the output channels. Tests in `tests/python/relax/test_frontend_onnx.py` were extended so `_verify_conv_transpose` checks 1D/2D/3D variants with `group=1` and `group=2`, plus a new `test_conv_transpose_invalid_bias_channel_count` asserting the error path. Covered by the updated tests in this PR; full suite runs in CI. Fixes #18600 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
