Skip to content

Fix Zamba2MambaMixer ignoring use_mamba_kernels=False#44853

Open
sergiopaniego wants to merge 3 commits intohuggingface:mainfrom
sergiopaniego:nemotron-mamba-kernel
Open

Fix Zamba2MambaMixer ignoring use_mamba_kernels=False#44853
sergiopaniego wants to merge 3 commits intohuggingface:mainfrom
sergiopaniego:nemotron-mamba-kernel

Conversation

@sergiopaniego
Copy link
Copy Markdown
Member

What does this PR do?

Zamba2MambaMixer.__init__ calls lazy_load_kernel("mamba-ssm") and lazy_load_kernel("causal-conv1d") unconditionally. Models that inherit from it (like NemotronH) and set use_mamba_kernels=False in their config have the flag ignored, causing failures when the kernels package is installed but causal-conv1d CUDA kernels are not available.

Fix: Gate the lazy_load_kernel calls behind getattr(config, "use_mamba_kernels", True) in the Zamba2 modular.

Related to: huggingface/trl#5278

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@ArthurZucker

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

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: nemotron_h, zamba2

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