Skip to content

Rename triton function#268

Merged
LoserCheems merged 3 commits intomainfrom
optim-combine-func
Apr 21, 2026
Merged

Rename triton function#268
LoserCheems merged 3 commits intomainfrom
optim-combine-func

Conversation

@LoserCheems
Copy link
Copy Markdown
Collaborator

No description provided.

- Added the `flash_sparse_forward.py` file containing the implementation of the Flash Sparse Attention forward kernel, including the `_fwd_inner_sparse_base_kernel` and `_fwd_base_sparse_kernel` functions.
- Updated the `interface.py` file to import the new Flash Sparse Attention forward functions from the newly created `flash_sparse_forward` module.
- Renamed imports for consistency, changing `flash_dense_fwd` to `flash_dense_forward`, `flash_dense_bwd` to `flash_dense_backward`, `flash_sparse_fwd` to `flash_sparse_forward`, `flash_sparse_bwd` to `flash_sparse_backward`, `flash_gated_fwd` to `flash_gated_forward`, and `flash_gated_bwd` to `flash_gated_backward`.
Copilot AI review requested due to automatic review settings April 21, 2026 09:27
@LoserCheems LoserCheems merged commit 3be126c into main Apr 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames Triton attention implementation modules (fwd/bwd) to clearer *_forward / *_backward names and updates call sites to use newly split-out Triton helper kernels for forward combine and backward pre/post-processing.

Changes:

  • Update imports in tests and Triton interface to new module names (*_forward, *_backward).
  • Replace references to old combine/preprocess/postprocess modules with new modules (flash_combine, flash_backward_preprocess, flash_backward_postprocess).
  • Add new Triton kernel modules for forward combine and backward pre/post-processing.

Reviewed changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_utils.py Updates imports to renamed Triton modules.
flash_sparse_attn/ops/triton/interface.py Updates public Triton interface imports to renamed modules.
flash_sparse_attn/ops/triton/flash_dense_forward.py Switches split-KV combine call to flash_combine.
flash_sparse_attn/ops/triton/flash_dense_backward.py Switches backward pre/post calls to new modules.
flash_sparse_attn/ops/triton/flash_sparse_forward.py Switches split-KV combine call to flash_combine.
flash_sparse_attn/ops/triton/flash_sparse_backward.py Switches backward pre/post calls to new modules.
flash_sparse_attn/ops/triton/flash_gated_forward.py Switches split-KV combine call to flash_combine.
flash_sparse_attn/ops/triton/flash_gated_backward.py Switches backward pre/post calls to new modules.
flash_sparse_attn/ops/triton/flash_combine.py New Triton kernel wrapper for combining split-KV forward partials.
flash_sparse_attn/ops/triton/flash_backward_preprocess.py New Triton kernel wrapper for backward preprocess (dPsum, LSE log2, dq_accum init).
flash_sparse_attn/ops/triton/flash_backward_postprocess.py New Triton kernel wrapper for backward postprocess (scale/store dq and optional da).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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