File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -948,12 +948,13 @@ def __init__(
948
948
"Please make sure to properly initialize your accelerator via `accelerator = Accelerator()` "
949
949
"before using any functionality from the `accelerate` library."
950
950
)
951
- # deepspeed handles mixed_precision using deepspeed_config
952
- self ._mixed_precision = (
953
- "no"
954
- if (self .distributed_type == DistributedType .DEEPSPEED and mixed_precision != "fp8" )
955
- else mixed_precision
956
- )
951
+ # deepspeed handles mixed_precision using deepspeed_config. But we need to set it to fp8
952
+ # if we're using fp8.
953
+ if self .distributed_type == DistributedType .DEEPSPEED and mixed_precision != "fp8" :
954
+ self ._mixed_precision = "no"
955
+ else :
956
+ self ._mixed_precision = mixed_precision
957
+
957
958
if self .distributed_type == DistributedType .XLA and is_torch_xla_available (check_is_tpu = True ):
958
959
if mixed_precision == "bf16" :
959
960
if os .environ .get ("ACCELERATE_DOWNCAST_BF16" ):
Original file line number Diff line number Diff line change @@ -543,11 +543,11 @@ def require_transformer_engine(test_case):
543
543
544
544
def require_transformer_engine_mxfp8 (test_case ):
545
545
"""
546
- Decorator marking a test that requires transformers engine FP8 block scaling available. These tests are skipped
547
- when transformers engine FP8 block scaling isn't available
546
+ Decorator marking a test that requires transformers engine MXFP8 block scaling available. These tests are skipped
547
+ when transformers engine MXFP8 block scaling isn't available
548
548
"""
549
549
return unittest .skipUnless (
550
- is_transformer_engine_mxfp8_available (), "test requires transformers engine FP8 block scaling"
550
+ is_transformer_engine_mxfp8_available (), "test requires transformers engine MXFP8 block scaling"
551
551
)(test_case )
552
552
553
553
You can’t perform that action at this time.
0 commit comments