transformers - 💡(How to fix) Fix `is_falcon_mamba_ssm_available` missing from `transformers.utils.import_utils` [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

ImportError: cannot import name 'is_falcon_mamba_ssm_available' from 'transformers.utils.import_utils'. Did you mean: 'is_mamba_ssm_available'?

Root Cause

src/transformers/models/falcon_mamba/modeling_falcon_mamba.py calls lazy_load_kernel("falcon_mamba-ssm"). With no kernels lib installed, src/transformers/integrations/hub_kernels.py::lazy_load_kernel derives the helper name as is_{name.replace("-","_")}_available — i.e. is_falcon_mamba_ssm_available — and getattr returns None because the helper isn't exported. falcon_mamba_inner_fn then resolves to None, the warn_slow_implementation guard fails, and the model falls into slow_forward — emitting:

Fix Action

Fixed

Code Example

from transformers.utils.import_utils import is_mamba_ssm_available           # ok
   from transformers.utils.import_utils import is_causal_conv1d_available       # ok
   from transformers.utils.import_utils import is_falcon_mamba_ssm_available    # ImportError

---

ImportError: cannot import name 'is_falcon_mamba_ssm_available' from
   'transformers.utils.import_utils'. Did you mean: 'is_mamba_ssm_available'?

---

is_falcon_mamba_ssm_available = is_mamba_ssm_available
RAW_BUFFERClick to expand / collapse

System Info

  • Reproduces on transformers==5.8.0 and on current main (verified by direct read of src/transformers/utils/import_utils.py).
  • Trigger condition: optional kernels lib is not installed (it lives in extras["kernels"] per setup.py, not in install_requires).
  • Platform / Python version independent — the bug is a pure ImportError from the public API surface.

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

  1. Install transformers without the [kernels] extra.

  2. Run:

    from transformers.utils.import_utils import is_mamba_ssm_available           # ok
    from transformers.utils.import_utils import is_causal_conv1d_available       # ok
    from transformers.utils.import_utils import is_falcon_mamba_ssm_available    # ImportError
  3. Observe:

    ImportError: cannot import name 'is_falcon_mamba_ssm_available' from
    'transformers.utils.import_utils'. Did you mean: 'is_mamba_ssm_available'?

src/transformers/models/falcon_mamba/modeling_falcon_mamba.py calls lazy_load_kernel("falcon_mamba-ssm"). With no kernels lib installed, src/transformers/integrations/hub_kernels.py::lazy_load_kernel derives the helper name as is_{name.replace("-","_")}_available — i.e. is_falcon_mamba_ssm_available — and getattr returns None because the helper isn't exported. falcon_mamba_inner_fn then resolves to None, the warn_slow_implementation guard fails, and the model falls into slow_forward — emitting:

Fast path is not available because one of (...) is None. Falling back to the sequential implementation of Mamba ... To install follow ... for mamba-ssm and ... for causal-conv1d.

A user with mamba_ssm and causal_conv1d already installed has no way to know the actual blocker is a missing helper rather than a missing package. The warning misdirects.

Pure mamba, mamba2, jamba, bamba, zamba, falcon_h1, granitemoehybrid, and nemotron_h are unaffected — they all call lazy_load_kernel("mamba-ssm"), which has its matching helper.

Expected behavior

is_falcon_mamba_ssm_available should be exported from transformers.utils.import_utils alongside its is_mamba_ssm_available / is_mamba_2_ssm_available / is_causal_conv1d_available siblings, so that lazy_load_kernel("falcon_mamba-ssm") resolves to the locally-installed mamba_ssm module via the fallback path.

Falcon-Mamba and Mamba share the same underlying kernel; the HF-Hub-packaged kernels-community/mamba-ssm/__init__.py already aliases falcon_mamba_inner_fn = mamba_inner_fn for the same reason.

Suggested one-line fix in src/transformers/utils/import_utils.py:

is_falcon_mamba_ssm_available = is_mamba_ssm_available

Matches the existing is_mamba_2_ssm_available helper style in the same file.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

is_falcon_mamba_ssm_available should be exported from transformers.utils.import_utils alongside its is_mamba_ssm_available / is_mamba_2_ssm_available / is_causal_conv1d_available siblings, so that lazy_load_kernel("falcon_mamba-ssm") resolves to the locally-installed mamba_ssm module via the fallback path.

Falcon-Mamba and Mamba share the same underlying kernel; the HF-Hub-packaged kernels-community/mamba-ssm/__init__.py already aliases falcon_mamba_inner_fn = mamba_inner_fn for the same reason.

Suggested one-line fix in src/transformers/utils/import_utils.py:

is_falcon_mamba_ssm_available = is_mamba_ssm_available

Matches the existing is_mamba_2_ssm_available helper style in the same file.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

transformers - 💡(How to fix) Fix `is_falcon_mamba_ssm_available` missing from `transformers.utils.import_utils` [1 pull requests]