Skip to content

[Fix][Relax] Lower non-contiguous WebGPU cumsum - #20133

Open
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:upstream/webgpu-cumsum-noncontiguous
Open

[Fix][Relax] Lower non-contiguous WebGPU cumsum#20133
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:upstream/webgpu-cumsum-noncontiguous

Conversation

@akaashrp

@akaashrp akaashrp commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

This PR adds a direct WebGPU lowering for inclusive cumsum along a non-innermost axis. Previously, these operations used TOPI’s generic transpose-based GPU scan. That lowering materializes a full-size transposed tensor and expands the scan into multiple WebGPU dispatches. This is unnecessarily resource-heavy for WebGPU, particularly when the scan extent is symbolic.

The new lowering reshapes any known-rank input into [outer, scan, inner] without transposing its data. Each GPU thread handles one (outer, inner) pair and scans the middle dimension serially. The result is then reshaped back to its original shape. The existing parallel kernel is still in use for innermost-axis scans. The new kernel is a correctness fallback that exposes parallelism across outer * inner but does not parallelize work along the scan dimension. Exclusive scans continue to use the existing lowering.

@akaashrp akaashrp changed the title [FIX][RELAX] Lower non-contiguous WebGPU cumsum [Fix][Relax] Lower non-contiguous WebGPU cumsum Aug 16, 2026
@yongwww yongwww closed this Aug 17, 2026
@yongwww yongwww reopened this Aug 17, 2026
@akaashrp

Copy link
Copy Markdown
Contributor Author

@tvm-bot rerun

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.

2 participants