unilab.base.process_device.apply_collector_tensor_device_override

unilab.base.process_device.apply_collector_tensor_device_override(env_cfg_override, backend_type, *, collector_tensor_device=None, learner_device=None)[source]

Return an env override selecting optional HOST_BRIDGE Torch carriers.

The input mapping is never mutated. training.collector_tensor_device is the explicit training contract: cpu remains on CPU and unindexed cuda is resolved to the current device by the environment. auto follows the learner device: a CUDA learner routes the rank-local (indexed) learner device string, while a CPU learner routes CPU and a torch.mps learner retains the owner/default CPU placement. Eligibility comes from the public SDK-free backend capability inventory: only a HOST_BRIDGE backend may route this key, and the requested device family/index must be in its declared torch_devices. auto is a no-op for backends outside that scope and when no learner device is known. The learner_device argument is the fallback for callers that do not compose a training configuration.

An explicit cpu request with a known CUDA learner fails closed (issue #2483) unless the build is ROCm/HIP or the run carries the UNILAB_ALLOW_CUDA_LEARNER_CPU_CARRIER attribution-baseline/debug opt-in.

Parameters:
Return type:

dict[str, Any]