get_jax_env_vars#
- SubslicePlacementGroup.get_jax_env_vars(worker_id: int | None = None, worker_hostnames: str | List[str] | None = None) Dict[str, str][source]#
Returns the JAX TPU environment variables for this subslice.
Process bounds are the subslice’s host grid and chips-per-process bounds are the chip grid of one host; see
get_jax_env_vars()for the remaining variables.- Parameters:
worker_id (int | None) – Optional integer ID of the worker within the subslice (0-indexed), between 0 and num_hosts - 1. Defaults to 0 on a single-host subslice; when omitted on a multi-host subslice,
TPU_WORKER_IDis not set (passworker_idper bundle on multi-host subslices soTPU_WORKER_IDoverrides the parent slice’s worker rank forlibtpuandjax.distributed).worker_hostnames (str | List[str] | None) – If omitted, resolved from the placement group bundles in this subslice.
- Returns:
A dictionary mapping JAX TPU environment variables to their values.
- Raises:
ValueError – If worker_id is out of bounds.
RuntimeError – If worker hostnames cannot be resolved.
- Return type: