Skip to content

Conversation

@ConvolutedDog
Copy link
Contributor

@ConvolutedDog ConvolutedDog commented Jul 12, 2025

  • Fix the ONNX CumSum converter to properly handle reversed cumsum operations by:
    • Flip the input before cumsum if reverse=True
    • Flip the output back to maintain original dimension order
    • Add proper normalization of the output of relax.op.cumsum
    • Add reverse=True test case to verify reversed cumsum operation

Details: This fixes #18135. ONNX allows users to explicitly specify the direction of cumsum through reverse. When reverse=True, the corresponding pseudo code is: flip(cumsum(flip(x, dims=[axis]), axis=axis), dims=[axis]).

@ConvolutedDog
Copy link
Contributor Author

@mshr-h Request a review.

@yongwww yongwww merged commit a519517 into apache:main Jul 13, 2025
14 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Error converting operator CumSum when 'reverse=1': (ptr) is false: The struct_info is not populated, check if you have normalized the expr

2 participants