Skip to content

[Mamba] Fix kernel loading#44176

Merged
vasqu merged 5 commits intohuggingface:mainfrom
vasqu:fix-mamba-kernel-loading
Feb 20, 2026
Merged

[Mamba] Fix kernel loading#44176
vasqu merged 5 commits intohuggingface:mainfrom
vasqu:fix-mamba-kernel-loading

Conversation

@vasqu
Copy link
Contributor

@vasqu vasqu commented Feb 20, 2026

Our kernel loading is incompatible with the original packages as they do not expose the same import structure:

  • Kernels seem to expose things in the init (and not in the original path)
  • Original packages seem to expose only within their original path (and not in the init, e.g. see here does not contain selective_state_update)

This is hard to test as you need to check within multiple different environments what packages are installed and whether things are properly loaded --> mamba2 was silently ignored even though the og pkg was there, mamba1 only luckily forced the issue leading to this discovery

@HuggingFaceDocBuilderDev

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.

@vasqu vasqu requested review from MekkCyber and hmellor February 20, 2026 15:30
def resolve_internal_import(module: ModuleType | None, chained_path: str) -> Callable | ModuleType | None:
"""
Check if a given `module` has an internal import path as defined by the `chained_path`.
This can either be the full path (not exposed in `__init__`) OR the last part of the chain (exposed in `__init__`).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are stuck with this either way now because we need BC

@github-actions
Copy link
Contributor

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

run-slow: bamba, falcon_h1, falcon_mamba, granitemoehybrid, jamba, mamba, mamba2, zamba, zamba2

Copy link
Contributor

@MekkCyber MekkCyber left a comment

Choose a reason for hiding this comment

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

Thanks for fxing 🤗

@vasqu vasqu merged commit 8795447 into huggingface:main Feb 20, 2026
25 checks passed
@vasqu vasqu deleted the fix-mamba-kernel-loading branch February 20, 2026 16:19
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