Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple fused Triton kernel for jagged_sum operator #2322

Closed
wants to merge 1 commit into from

Conversation

jananisriram
Copy link
Contributor

Summary:
Add Triton kernel implementation to jagged_sum operator in TritonBench. This Triton kernel performs a sum along the ragged dimension of a nested tensor of logical dimensions (B, *, M), where * is the ragged dimension. It loads in blocks of the values tensor along its last dimension M, reduces each block of variable length along its first dimension *, and stores each of B reductions in an output tensor of shape (B, M).

This Triton kernel is benchmarked against two PyTorch implementations, one which does not pad blocks of variable length and one which does pad.

Reviewed By: davidberard98

Differential Revision: D58549297

Summary:
Add Triton kernel implementation to `jagged_sum` operator in TritonBench. This Triton kernel performs a sum along the ragged dimension of a nested tensor of logical dimensions `(B, *, M)`, where `*` is the ragged dimension.  It loads in blocks of the `values` tensor along its last dimension `M`, reduces each block of variable length along its first dimension `*`, and stores each of `B` reductions in an output tensor of shape `(B, M)`.

This Triton kernel is benchmarked against two PyTorch implementations, one which does not pad blocks of variable length and one which does pad.

Reviewed By: davidberard98

Differential Revision: D58549297
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D58549297

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a3af772.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants