javierdejesusda opened a new pull request, #19773:
URL: https://github.com/apache/tvm/pull/19773
### Root Cause
The ONNX `CumSum` converter in the Relax frontend rejected any node with
`exclusive=1` via a bare
`assert not attr.get("exclusive", False), "Exclusive option not yet
supported."`, so importing a
model that used exclusive cumulative sums failed with `AssertionError:
Exclusive option not yet
supported.`. The underlying op already supports the exclusive form:
`relax.op.cumsum` forwards an
`exclusive` flag to the FFI and `topi/scan.py` implements the exclusive
branch, so the converter
only needed to pass the attribute through.
### Solution
Drop the assert and read the attribute as `exclusive = attr.get("exclusive",
0) != 0` (matching the
existing `attr.get("reverse", 0) != 0` idiom in the same converter), then
pass it to
`relax.op.cumsum(data, axis, exclusive=exclusive)`. The existing reverse
handling
(`flip -> cumsum -> flip`) composes correctly with exclusive, so `reverse=1,
exclusive=1` lowers to
an exclusive scan over the reversed axis.
### Test Plan
Extended `test_cumsum` in `tests/python/relax/test_frontend_onnx.py` to
parametrize `exclusive` over
`[True, False]`, so `check_correctness` now exercises all four `(reverse,
exclusive)` combinations
against ONNX Runtime:
```
python -m pytest tests/python/relax/test_frontend_onnx.py::test_cumsum -v
```
### Issue
Fixes #19692
--
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]