MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _get_device

Function _get_device

deepspeed/inference/quantization/utils.py:16–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15
16def _get_device():
17 # Resolved when needed instead of at import, because is_available() queries the GPUs, which slows down
18 # import deepspeed.
19 return get_accelerator().device_name() if get_accelerator().is_available() else 'cpu'
20
21
22quantizer_module = None

Callers 1

dequantizeMethod · 0.85

Calls 3

get_acceleratorFunction · 0.90
device_nameMethod · 0.45
is_availableMethod · 0.45

Tested by

no test coverage detected