Skip to content

[Kernels] Sync and add SwigluMLP + CausalLMLoss#46039

Draft
vasqu wants to merge 3 commits into
huggingface:mainfrom
vasqu:causallm-kernels
Draft

[Kernels] Sync and add SwigluMLP + CausalLMLoss#46039
vasqu wants to merge 3 commits into
huggingface:mainfrom
vasqu:causallm-kernels

Conversation

@vasqu
Copy link
Copy Markdown
Contributor

@vasqu vasqu commented May 18, 2026

WIP

Need to fix the upstream init of the kernel - see https://gist.github.com/vasqu/09cc54006faae94460fe6470bc638ed8 (same for rope)

  • We had _ instead of - so it pointed to the wrong repo lmao
  • We have a few validation strictness issues, e.g.
    • Match signature when fn
    • No init for module
  • Torch compile support will also need additional changes in kernels to register can_torch_compile flag if given
  • RMS Norm needs investigation why it fails under compile
  • We should be able to support training but not compile (rms norm)

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

looks nice!

Copy link
Copy Markdown
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

BTW make sure to put benches on perfs wins /. doc

@vasqu
Copy link
Copy Markdown
Contributor Author

vasqu commented May 19, 2026

Yep, will do 🫡 thinking about memory benchmarks mostly since this is the key behind the new loss kernel from liger

i red herred that maybe the registry was not properly working for fn repos, but thats all fine. still need small upstream changes tho
@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: llama

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.

3 participants