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

Function preferred_dtype

tests/unit/common.py:515–521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

513
514# bf16 > fp16 > fp32
515def preferred_dtype():
516 if get_accelerator().is_bf16_supported():
517 return torch.bfloat16
518 elif get_accelerator().is_fp16_supported():
519 return torch.float16
520 else:
521 return torch.float32
522
523
524class EnableDeterminism:

Calls 3

get_acceleratorFunction · 0.90
is_bf16_supportedMethod · 0.45
is_fp16_supportedMethod · 0.45