keras-team/keras · error · RuntimeError

Require at least Ampere arch to run

Error message

Require at least Ampere arch to run

What it means

Error "Require at least Ampere arch to run" thrown in keras-team/keras.

Source

Thrown at keras/src/backend/jax/nn.py:1487

        from jax.nn import dot_product_attention as dot_product_attention
    except ImportError:
        if raise_error:
            raise ImportError(
                "Flash attention is not supported in your current JAX version. "
                "Please update it by following the official guide: "
                "https://jax.readthedocs.io/en/latest/installation.html"
            )
        return False

    if jax.devices()[0].platform == "tpu":
        return True
    try:
        # Check if cuDNN is installed and raise RuntimeError if cuDNN is not
        # detected
        cudnn_version = check_cudnn_version()
        # Only support at least Ampere
        if not check_compute_capability("8.0"):
            raise RuntimeError("Require at least Ampere arch to run")

        # Inspect inputs of `check_layout`
        check_layout_params = list(
            inspect.signature(check_layout).parameters.keys()
        )
        for known_param in ("query", "key", "value", "bias", "layout"):
            check_layout_params.remove(known_param)
        # Defaults to `None` when not specified.
        check_layout_kwargs = {key: None for key in check_layout_params}
        check_layout(
            query,
            key,
            value,
            bias,
            layout=_normalize_layout("BTNH"),
            **check_layout_kwargs,
        )

View on GitHub (pinned to 7a34a03db6)

When it happens

Trigger: Thrown at keras/src/backend/jax/nn.py:1487 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25). Data as JSON: /api/errors/26b8616bed12948d. Report an issue: GitHub.