Skip to content

causal-conv1d: add layers module for LayerRepository - #1137

Open
kaixuanliu wants to merge 2 commits into
huggingface:mainfrom
kaixuanliu:conv1d-layers
Open

causal-conv1d: add layers module for LayerRepository#1137
kaixuanliu wants to merge 2 commits into
huggingface:mainfrom
kaixuanliu:conv1d-layers

Conversation

@kaixuanliu

Copy link
Copy Markdown
Contributor

Adds a layers submodule to causal-conv1d, exposing causal_conv1d_fn and causal_conv1d_update as nn.Module wrappers so the repo can be consumed via LayerRepository / kernelize(), as transformers will deprecate FuncRepository Soon. @danieldk , pls help review, thx!

Signed-off-by: kaixuanliu <kaixuan.liu@intel.com>
@github-actions github-actions Bot added the chore Version bumps, releases, misc maintenance label Sep 4, 2026
danieldk
danieldk previously approved these changes Sep 4, 2026
@danieldk

danieldk commented Sep 4, 2026

Copy link
Copy Markdown
Member

/kernel-bot build causal-conv1d

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build causal-conv1d
Mode: build only
Target branch: pr-1137
PR head SHA: 4f0fa09bca095b0a75cdda9c512ced1e1e661134
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

__all__ = ["causal_conv1d_fn", "causal_conv1d_update", "causal_conv1d_varlen_states"]
__all__ = [
# wrappers
"layers",

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.

Since this changes the API, could you bump up the version in build.toml?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, Done.

Signed-off-by: kaixuanliu <kaixuan.liu@intel.com>
@vasqu

vasqu commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

It's a bit weird because we already use mamba-ssm and its causal conv1d as layers in transformers no? Not sure what the benefit here is other than additional maintenance 👀

@vasqu

vasqu commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@kaixuanliu

kaixuanliu commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@vasqu Yes, in transformers we use mamba-ssm for cuda. Not sure if the implementation is the same as causal_conv1D, if they share the same code, we can move the impl of XPU kernel to this path. @danieldk do you have some comments?

@vasqu

vasqu commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Pretty sure it should be the same implementation (mamba uses it for its fused training path)

@danieldk

danieldk commented Sep 4, 2026

Copy link
Copy Markdown
Member

Yeah, I think it'd make most sense to use mamba-ssm, but I don't think it hurts syncing the layers in this kernel with mamba-ssm.

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Okay let's do it here as well. Tbh it really doesn't hurt to have it on both sides ig

Would be still great to check what XPU could use on transformers side then 🤗 (you can cc me there then)

@danieldk

danieldk commented Sep 4, 2026

Copy link
Copy Markdown
Member

/kernel-bot build causal-conv1d

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Build request processed.

Command: /kernel-bot build causal-conv1d
Mode: build only
Target branch: pr-1137
PR head SHA: 22293ce5be075a208f139b2107b57137554faf67
Workflows: build.yaml, build-mac.yaml, build-windows.yaml

Dispatched (1):

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

Labels

chore Version bumps, releases, misc maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants