jax-ml/jax · error · ValueError
Mock topology must be of the form "<number-of-slices> x…
Error message
Mock topology must be of the form "<number-of-slices> x <number-of-hosts-per-slice> x <number-of-devices-per-host>".
What it means
Validation in get_num_nodes_from_gpu_topology: the JAX_GPU_TOPOLOGY-style string must have the form "<slices> x <hosts-per-slice> x <devices-per-host>" with 'x' separators. Fires when the topology string cannot be parsed into three numeric components.
Solutions
- Format the topology string as '<slices>x<hosts-per-slice>x<devices-per-host>', e.g. '2x2x4'
- Strip whitespace or extra separators before passing the string
- Validate with topology.split('x') producing exactly 3 parts before calling
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at jax/_src/xla_bridge.py:372 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27).
Data as JSON: /api/errors/d4d30f0b6f62c344.
Report an issue: GitHub.
Appendix: source
Thrown at jax/_src/xla_bridge.py:372
num_nodes=distributed.global_state.num_processes,
collectives=collectives,
num_devices=num_devices,
get_local_topology_timeout_minutes=cpu_get_local_topology_timeout_minutes.value,
get_global_topology_timeout_minutes=cpu_get_global_topology_timeout_minutes.value,
transfer_server_factory=_make_transfer_server_factory(),
)
register_backend_factory(
"cpu", make_cpu_client, priority=0, fail_quietly=False
)
def get_num_nodes_from_gpu_topology(topology: str) -> int:
try:
slices_str, hosts_per_slice_str, _ = topology.split("x", 2)
return int(slices_str) * int(hosts_per_slice_str)
except (IndexError, ValueError):
raise ValueError('Mock topology must be of the form '
'"<number-of-slices> x <number-of-hosts-per-slice> x '
'<number-of-devices-per-host>".')
# TODO(phawkins,skyewm): switch TPU plugin to use the PJRT plugin mechanism,
# and then fail loudly on initialization failure.
register_backend_factory(
'tpu', partial(tpu_client_timer_callback, timer_secs=60.0), priority=300,
fail_quietly=True)
def _get_pjrt_plugin_names_and_library_paths(
plugins_from_env: str,
) -> dict[str, str]:
"""Gets the names and library paths of PJRT plugins to load from env var.
Args:
plugins_from_env: plugin name and paths from env var. It is in the format
of 'name1:path1,name2:path2' ('name1;path1,name2;path2' for windows).View on GitHub (pinned to 1e1c6a8fc0)