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
- List valid options via jax.config.values (or dir(jax.config)) and use the exact name
- Check the installed version's config docs/changelog: the flag may be renamed or removed
- 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
- Wrap config updates in a helper that checks jax.config.values first
- Pin the JAX version in requirements to keep option names stable
- Add a startup test asserting the options you use exist
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
- invalid truth value {val!r} for environment {varname!r}
- For flags with a corresponding contextmanager, read their va
- Config option {name} already defined
- bool() not supported for instances of type '{0}' (did you me
- Context manager for {state.__name__} config option requires
AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27).
Data as JSON: /api/errors/18b361bf4e267abb.
Report an issue: GitHub.