MCPcopy
hub / github.com/mosaicml/composer / _validate_precision

Function _validate_precision

composer/core/precision.py:40–43  ·  view source on GitHub ↗

Validate the precision and device combination.

(precision: Precision, device: Device)

Source from the content-addressed store, hash-verified

38
39
40def _validate_precision(precision: Precision, device: Device):
41 """Validate the precision and device combination."""
42 if isinstance(device, DeviceCPU) and precision != Precision.FP32:
43 raise ValueError(f'{precision} is not supported for CPU training.')
44
45
46@contextlib.contextmanager

Callers 4

prepare_fsdp_moduleFunction · 0.90
parallelize_modelFunction · 0.90
__init__Method · 0.90
fitMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected