unilab.base.process_device.pin_genesis_device_before_cuda_init¶
- unilab.base.process_device.pin_genesis_device_before_cuda_init(backend_type, *, learner_device=None)[source]¶
Pin Genesis to its rank device before the first torch CUDA call.
torch.cuda.is_available()already latchesCUDA_VISIBLE_DEVICESin the CUDA runtime, so the pin must run ahead of any torch CUDA query — entrypoints should call this before registry/bootstrap/device detection. An explicit non-Genesiscuda:Nlearner device resolves without touching torch. Returns the in-process device the caller must use when a pin happened, elseNone.