Skip to content

fla: add kdn kernels - #1010

Merged
vasqu merged 8 commits into
mainfrom
add-fla-kernels
Jul 8, 2026
Merged

vasqu merged 8 commits into
mainfrom
add-fla-kernels

Conversation

@vasqu

@vasqu vasqu commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

As per title, starts to add the kernels from FLA. Since these are mostly implemented in triton there is no extra deps for the most part. There are some tilelang implementations but would ignore them for now. Same kernels also over here for example: https://huggingface.co/kernels/AntonV/fla

I only focused on gdn and kdn but would like to gradually update this. Should this be version 0 then maybe.

from .modules.fused_norm_gate import rms_norm_gated


class FusedRMSNormGated(nn.Module):

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 is for the future, e.g. we can use this for qwen 3.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.

If it's for the future, does it need to be present in this PR?

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, confirmed that I will need this internally. I will check a bit if this is the correct variation before merge tho

Comment thread fla/build.toml
python-depends = ["einops"]

[general.hub]
repo-id = "kernels-community/fla"

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.

What do we think about asking the partner if we could host the kernels under their namespace, similar to what we did for Minimax? Cc: @LysandreJik

For the build, we can push to kernels-community and then have one of the admins transfer it to their namespace. But after that, we can update this to the partner namespace (once there is agreement).

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.

So you mean under the FLA organization? Imo, that sounds good to me; wanted to credit them in shape or form in any case

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.

Yup. So something like FLA/fla or whatever their org namespace is.

@@ -58,6 +58,7 @@
"aiter-kernels": "https://github.com/ROCm/aiter",
# Too much stuff happening in vLLM, not worth reporting as MoE freshness.
"vllm-moe": "",
"fla": "github.com/fla-org/flash-linear-attention",

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.

Sweet!

sayakpaul
sayakpaul previously approved these changes Jul 3, 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.

Let's get the nix formatting fixed.

@vasqu

vasqu commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Checking whether to add causal conv1d here as well so withholding for a bit until I've settled on that

@drbh drbh added backend: cuda NVIDIA CUDA kernels backend: triton Vendor-neutral Triton kernels new-kernel A brand-new kernel package is added type: feature New functionality / capability cuda NVIDIA CUDA kernels feature New functionality / capability triton Vendor-neutral Triton kernels and removed backend: cuda NVIDIA CUDA kernels backend: triton Vendor-neutral Triton kernels type: feature New functionality / capability labels Jul 6, 2026
@vasqu vasqu changed the title fla: add gdn and kdn kernels fla: add kdn kernels Jul 7, 2026
sayakpaul
sayakpaul previously approved these changes Jul 8, 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.

Thanks. Let's try to transfer the kernel repo to the actual org if possible after it's been merged.

We're working on huggingface/kernels#694 which will allow us to open PRs to these repos (where we don't have write access) through our CI automatically :)

@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.

Let's wait till the build is successful?

@vasqu
vasqu merged commit 80bc07a into main Jul 8, 2026
4 checks passed
@vasqu

vasqu commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/kernel-bot merge-and-upload fla

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot merge-and-upload fla
Mode: merge, build and upload
Target branch: ``
PR head SHA: a8481647aa81942696d0a477886f5bafb9384c09
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

cuda NVIDIA CUDA kernels feature New functionality / capability new-kernel A brand-new kernel package is added triton Vendor-neutral Triton kernels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants