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

Function get_accelerator

colossalai/accelerator/api.py:60–71  ·  view source on GitHub ↗

Return the accelerator for the current process. If the accelerator is not initialized, it will be initialized to the default accelerator type. Returns: the accelerator for the current process.

()

Source from the content-addressed store, hash-verified

58
59
60def get_accelerator() -> BaseAccelerator:
61 """
62 Return the accelerator for the current process. If the accelerator is not initialized, it will be initialized
63 to the default accelerator type.
64
65 Returns: the accelerator for the current process.
66 """
67 global _ACCELERATOR
68
69 if _ACCELERATOR is None:
70 auto_set_accelerator()
71 return _ACCELERATOR

Callers 15

trainFunction · 0.90
mainFunction · 0.90
trainFunction · 0.90
__init__Method · 0.90
launchFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
zero_gradMethod · 0.90
get_current_deviceFunction · 0.90
current_timeMethod · 0.90
startMethod · 0.90
stopMethod · 0.90

Calls 1

auto_set_acceleratorFunction · 0.85

Tested by 15

pytest_runtest_setupFunction · 0.72
__init__Method · 0.72
test_fused_adam_kernelFunction · 0.72
check_p2p_communicationFunction · 0.72
check_4gpuFunction · 0.72
check_4gpuFunction · 0.72
check_4gpuFunction · 0.72
check_4gpuFunction · 0.72
test_fp8_castFunction · 0.72
check_4gpuFunction · 0.72
check_all2allFunction · 0.72
check_all2all_unevenFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…