resolve

jaxrens.cli.resolve.resolve(root)[source]

Translate a validated RootSpec into one unified ResolvedConfig.

Topology resolution decides the batcher:

  • n_total == 1 (scalar pressure, no inter-RE replica-axis list) → SingleRun(). Init arrays carry shape (K, ...).

  • n_total >= 2 → PmapVmapRuns(n_gpu, n_per_gpu) with n_gpu = max(1, len(jax.local_devices())) clamped to n_total. Init arrays carry shape (n_total, K, ...); the dispatcher reshapes to (n_gpu, n_per_gpu, K, ...) at consume time.

Future case “single NS sharded across multiple GPUs” will be a third branch keyed on a new batcher type — orthogonal to this dispatcher.

Parameters:

root (RootSpec) – Fully validated pydantic config.

Returns:

Single ResolvedConfig carrying the resolved batcher.

Raises:

ValueError – Replica-axis list lengths disagree, n_total is not divisible by the detected device count, or a pressure-flavor inter-RE has a scalar ensemble.pressure.

Return type:

ResolvedConfig