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_ID is not set (pass worker_id per bundle on multi-host subslices so TPU_WORKER_ID overrides the parent slice’s worker rank for libtpu and jax.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:
Return type:

Dict[str, str]