mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-06 19:40:28 +00:00
[misc] update pre-commit and run all files (#4752)
* [misc] update pre-commit * [misc] run pre-commit * [misc] remove useless configuration files * [misc] ignore cuda for clang-format
This commit is contained in:
@@ -6,16 +6,22 @@ from .fp16_torch import FP16TorchMixedPrecision
|
||||
from .mixed_precision_base import MixedPrecision
|
||||
|
||||
__all__ = [
|
||||
'MixedPrecision', 'mixed_precision_factory', 'FP16_Apex_MixedPrecision', 'FP16_Torch_MixedPrecision',
|
||||
'FP32_MixedPrecision', 'BF16_MixedPrecision', 'FP8_MixedPrecision', 'FP16NaiveMixedPrecision'
|
||||
"MixedPrecision",
|
||||
"mixed_precision_factory",
|
||||
"FP16_Apex_MixedPrecision",
|
||||
"FP16_Torch_MixedPrecision",
|
||||
"FP32_MixedPrecision",
|
||||
"BF16_MixedPrecision",
|
||||
"FP8_MixedPrecision",
|
||||
"FP16NaiveMixedPrecision",
|
||||
]
|
||||
|
||||
_mixed_precision_mapping = {
|
||||
'fp16': FP16TorchMixedPrecision,
|
||||
'fp16_apex': FP16ApexMixedPrecision,
|
||||
'fp16_naive': FP16NaiveMixedPrecision,
|
||||
'bf16': BF16MixedPrecision,
|
||||
'fp8': FP8MixedPrecision
|
||||
"fp16": FP16TorchMixedPrecision,
|
||||
"fp16_apex": FP16ApexMixedPrecision,
|
||||
"fp16_naive": FP16NaiveMixedPrecision,
|
||||
"bf16": BF16MixedPrecision,
|
||||
"fp8": FP8MixedPrecision,
|
||||
}
|
||||
|
||||
|
||||
@@ -31,5 +37,5 @@ def mixed_precision_factory(mixed_precision_type: str) -> MixedPrecision:
|
||||
return _mixed_precision_mapping[mixed_precision_type]()
|
||||
else:
|
||||
raise ValueError(
|
||||
f'Mixed precision type {mixed_precision_type} is not supported, support types include {list(_mixed_precision_mapping.keys())}'
|
||||
f"Mixed precision type {mixed_precision_type} is not supported, support types include {list(_mixed_precision_mapping.keys())}"
|
||||
)
|
||||
|
Reference in New Issue
Block a user