MCPcopy
hub / github.com/hpcaitech/ColossalAI / set_device

Method set_device

colossalai/accelerator/cpu_accelerator.py:45–49  ·  view source on GitHub ↗

Bind the current process to a device.

(self, device: Optional[Union[torch.device, int]] = None)

Source from the content-addressed store, hash-verified

43 raise RuntimeError("this method is not supported for cpu accelerator")
44
45 def set_device(self, device: Optional[Union[torch.device, int]] = None) -> None:
46 """
47 Bind the current process to a device.
48 """
49 raise RuntimeError("this method is not supported for cpu accelerator")
50
51 def get_device_name(self, device: Union[torch.device, int]) -> str:
52 """

Callers 15

launchFunction · 0.45
_set_cuda_deviceMethod · 0.45
_init_modelMethod · 0.45
bindMethod · 0.45
opt_model_forwardMethod · 0.45
gpt2_model_forwardMethod · 0.45
t5_stack_forwardMethod · 0.45
gptj_model_forwardMethod · 0.45
forwardFunction · 0.45

Calls

no outgoing calls

Tested by 9

run_deepseek_commomFunction · 0.36
run_mixtral_commomFunction · 0.36
check_mixtral_moe_layerFunction · 0.36
check_deepseek_moe_layerFunction · 0.36
check_moe_checkpointFunction · 0.36