jax-ml/jax · error · AttributeError

Unrecognized config option: {name}

Error message

Unrecognized config option: {name}

What it means

jax.config.update (and the absl-style FLAGS update path) only accepts options that were registered via config state definitions (bool_state, enum_state, etc.). Calling update with a name not present in the registry raises AttributeError before any value is set. This protects against silently creating typo'd or version-mismatched options.

Source

Thrown at jax/_src/config.py:98

class Config:
  _HAS_DYNAMIC_ATTRIBUTES = True
  if TYPE_CHECKING:

    def __getattr__(self, name: str) -> Any:
      ...

    def __setattr__(self, name: str, value: Any) -> None:
      ...

  def __init__(self):
    self._value_holders: dict[str, ValueHolder] = {}
    self.meta = {}
    self.use_absl = False
    self._contextmanager_flags = set()

  def update(self, name, val):
    if name not in self._value_holders:
      raise AttributeError(f"Unrecognized config option: {name}")
    self._value_holders[name]._set(val)

  def read(self, name):
    if name in self._contextmanager_flags:
      raise AttributeError(
          "For flags with a corresponding contextmanager, read their value "
          f"via e.g. `config.{name}` rather than `config.FLAGS.{name}`.")
    return self._read(name)

  def _read(self, name):
    try:
      return self._value_holders[name].value
    except KeyError:
      raise AttributeError(f"Unrecognized config option: {name}")

  @property
  def values(self):
    return {name: holder.value for name, holder in self._value_holders.items()}

View on GitHub (pinned to 1e1c6a8fc0)

Solutions

  1. List valid options via jax.config.values (or dir(jax.config)) and use the exact name
  2. Check the installed version's config docs/changelog: the flag may be renamed or removed
  3. If intentional, define the option first with jax.config.define_bool_state / enum_state before update

Example fix

# before
jax.config.update('jax_enable_x64s', True)
# after
jax.config.update('jax_enable_x64', True)
Defensive patterns

Strategy: validation

Validate before calling

import jax

def safe_config_update(name, value):
    if name not in jax.config.values:
        avail = [n for n in jax.config.values if n.startswith('jax_')]
        raise KeyError(f'{name!r} not a JAX option; available: {avail}')
    jax.config.update(name, value)

safe_config_update('jax_enable_x64', True)

Try / catch

try:
    jax.config.update(name, val)
except AttributeError:
    # option missing in this JAX version; skip or migrate
    pass

Prevention

When it happens

Trigger: jax.config.update('jax_enable_x64s', True) (typo), using an option removed/renamed in the installed JAX version, or calling config.update with a custom name never defined via jax.config.define_bool_state etc.

Common situations: Upgrading JAX where a flag was renamed or removed; copying config.update calls from StackOverflow for a different JAX version; typo in flag name in a setup script.

Related errors


AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27). Data as JSON: /api/errors/18b361bf4e267abb. Report an issue: GitHub.