Skip to content

Commit bf66a98

Browse files
authored
Require dist optimizer with --fp4-param-gather (#8009)
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
1 parent e95ea35 commit bf66a98

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎megatron/training/arguments.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,10 @@ def validate_args(args, defaults={}):
978978
assert args.use_distributed_optimizer or args.use_torch_fsdp2 or args.use_megatron_fsdp or not torch.is_grad_enabled(), \
979979
'--fp8-param-gather only supported with distributed optimizer, torch fsdp2, megatron fsdp, or inference mode'
980980

981+
if args.fp4_param_gather:
982+
assert args.use_distributed_optimizer or args.use_torch_fsdp2 or args.use_megatron_fsdp or not torch.is_grad_enabled(), \
983+
'--fp4-param-gather only supported with distributed optimizer, torch fsdp2, megatron fsdp, or inference mode'
984+
981985
# FP4 and FP8 are mutually exclusive
982986
if args.fp4 and args.fp8:
983987
raise ValueError("--fp4-format and --fp8-format cannot be used simultaneously. Please choose one.")

0 commit comments

Comments
 (0)