unilab.training.tensor_runtime

Hydra config resolution for the off-policy tensor-runtime contract.

Merged from unilab_rl @ 3654e4b (unilab-rl 1.4.15), Apache-2.0; previously uni_rl.utils.tensor_runtime. Reading the owner DictConfig is training assembly business, so these resolvers live here; the bounded constants and value objects they produce live in unilab.rl.runtime.settings and unilab.rl.runtime.placement.

Functions

resolve_collector_metrics_interval(cfg, *, ...)

Resolve the device-metric compaction/reporting interval.

resolve_collector_tensor_placement(cfg, *, ...)

Resolve placement from the owner config's single config-source tree.

resolve_inference_slot_capacity(cfg, *, ...)

Resolve the bounded inference-ring capacity before IPC construction.

resolve_recorded_collector_tensor_device(...)

Resolve the collector-tensor device recorded in run_config.json.

resolve_runtime_settings(cfg, *, algo_name, ...)

Resolve all spawn-facing tensor-runtime knobs and learner sampling.

select_collector_tensor_device(cfg)

Select the collector-tensor device request and reject removed keys.

unilab.training.tensor_runtime.select_collector_tensor_device(cfg)[source]

Select the collector-tensor device request and reject removed keys.

Parameters:

cfg (DictConfig)

Return type:

str

unilab.training.tensor_runtime.resolve_recorded_collector_tensor_device(sim_backend, env_cfg_override)[source]

Resolve the collector-tensor device recorded in run_config.json.

Every HOST_BRIDGE backend routes training.collector_tensor_device; gating the record on one backend name drops the resolved device from the other HOST_BRIDGE backends’ run configs.

Parameters:
Return type:

str | None

unilab.training.tensor_runtime.resolve_collector_tensor_placement(cfg, *, device, algo_name)[source]

Resolve placement from the owner config’s single config-source tree.

Parameters:
  • cfg (DictConfig)

  • device (str)

  • algo_name (str)

Return type:

InferencePlacement

unilab.training.tensor_runtime.resolve_inference_slot_capacity(cfg, *, algo_name)[source]

Resolve the bounded inference-ring capacity before IPC construction.

Parameters:
  • cfg (DictConfig)

  • algo_name (str)

Return type:

int

unilab.training.tensor_runtime.resolve_collector_metrics_interval(cfg, *, algo_name)[source]

Resolve the device-metric compaction/reporting interval.

Parameters:
  • cfg (DictConfig)

  • algo_name (str)

Return type:

int

unilab.training.tensor_runtime.resolve_runtime_settings(cfg, *, algo_name, num_envs)[source]

Resolve all spawn-facing tensor-runtime knobs and learner sampling.

Parameters:
  • cfg (DictConfig)

  • algo_name (str)

  • num_envs (int)

Return type:

RuntimeSettings