Skip to content

feat: prefer torch stable abi for cuda fa2#997

Merged
drbh merged 7 commits into
mainfrom
flash-attn2-stable-abi
Jul 20, 2026
Merged

feat: prefer torch stable abi for cuda fa2#997
drbh merged 7 commits into
mainfrom
flash-attn2-stable-abi

Conversation

@drbh

@drbh drbh commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

work in progress to move fa2 to torch stable abi

Warning

stable abi 2.10 does not support RNG so dropout is disabled.

related PR Dao-AILab/flash-attention#2691

@drbh

drbh commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot build flash-attn2

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build flash-attn2
Mode: build only
Target branch: pr-997
PR head SHA: 04c14913159eb8d22a67d4909db16d4d3fffb229
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

Signed-off-by: David Holtz <david.richard.holtz@gmail.com>
@drbh

drbh commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot build flash-attn2

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build flash-attn2
Mode: build only
Target branch: pr-997
PR head SHA: 114e5a04421b07ae786314f6c0e931a293733bbe
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

@drbh drbh added abi-migration Torch stable ABI work area: build-system build.toml, Nix flakes, packaging, and kernel-builder integration backend: cuda NVIDIA CUDA kernels needs-rebase Has merge conflicts with the base branch size: XL Diff > 1000 lines type: build Build system: nix flakes, kernel-builder build, packaging build Build system: nix flakes, kernel-builder build, packaging cuda NVIDIA CUDA kernels feature New functionality / capability and removed area: build-system build.toml, Nix flakes, packaging, and kernel-builder integration backend: cuda NVIDIA CUDA kernels size: XL Diff > 1000 lines type: build Build system: nix flakes, kernel-builder build, packaging abi-migration Torch stable ABI work build Build system: nix flakes, kernel-builder build, packaging cuda NVIDIA CUDA kernels labels Jun 30, 2026
@drbh

drbh commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot build flash-attn2

1 similar comment
@drbh

drbh commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot build flash-attn2

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build flash-attn2
Mode: build only
Target branch: pr-997
PR head SHA: ac48cbc05a7af94f94ae95c5ee6b9122d16e13fb
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

@drbh

drbh commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot build flash-attn2

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build flash-attn2
Mode: build only
Target branch: pr-997
PR head SHA: 1e6c204cd27109a1e562e9e74c7bc33360a96a4c
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

@drbh

drbh commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot build-and-stage flash-attn2

@drbh
drbh marked this pull request as ready for review July 8, 2026 14:01
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build-and-stage flash-attn2
Mode: build and stage
Target branch: pr-997
PR head SHA: 1e6c204cd27109a1e562e9e74c7bc33360a96a4c
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

@drbh drbh removed the needs-rebase Has merge conflicts with the base branch label Jul 8, 2026
@drbh drbh mentioned this pull request Jul 10, 2026
@sayakpaul

Copy link
Copy Markdown
Member

/kernel-bot build-and-stage flash-attn2

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build-and-stage flash-attn2
Mode: build and stage
Target branch: pr-997
PR head SHA: 1e6c204cd27109a1e562e9e74c7bc33360a96a4c
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

Comment thread flash-attn2/build.toml
[general]
name = "flash-attn2"
version = 2
version = 3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are we changing signatures?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes we ignore an argument and drop support for dropout

Comment thread flash-attn2/build.toml
version = 2
version = 3
license = "BSD-3-Clause"
edition = 5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remind me why do we need the edition field? Didn't find too much explanation under https://huggingface.co/docs/kernels/main/en/builder/writing-kernels#general.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this was just added for backend scoped stable abis, its basically a versioning for the metadata, an earlier discussion is here huggingface/kernels#682 (comment)

sayakpaul
sayakpaul previously approved these changes Jul 11, 2026

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Super cool!

"int window_size_right, "
"float softcap, "
"bool deterministic, "
"Generator? gen_, "

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think Generator is supported in the schema as of 2.10--I added it in 2.13! But I suspect this works because gen_ is always None? Could you call out the supported/no longer supported features in this implementation? I've also been trying to get upstream to adopt stable dropoutless FA2 through a more explicit approach: Dao-AILab/flash-attention#2691

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ah thanks for pointing out, yea the Generator is always unused in these changes and was silently dropped. I've updated to throw if a generator is passed to be more explicit about not supporting.

and I've updated the pr description to more clearly indicate that dropout is disabled in this change set.

also longer term it would be great to replace the current approach with your changes once they are upstreamed. I'll keep and eye for the merge and circle back!

thanks for the help @janeyx99!

@drbh
drbh merged commit 2d6ecf3 into main Jul 20, 2026
4 of 5 checks passed
@drbh

drbh commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot merge-and-upload flash-attn2

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot merge-and-upload flash-attn2
Mode: merge, build and upload
Target branch: ``
PR head SHA: 24d4ca5b86dbe5b9bd41ccef0bd852f3878e7bff
Workflows: `build.yaml, build-mac.yaml, build-windows.yaml`

Merge result: PR is already merged. Continuing with build/upload.

Dispatched (1):

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

Labels

feature New functionality / capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants