Skip to content

Commit

Permalink
GRT-2819 fix overwritting in script (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
cli99 authored Apr 10, 2024
1 parent 7337429 commit b5fc0fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ def validate_config(cfg: DictConfig):
fsdp_config = cfg.get('fsdp_config', None)
act_ckpt = fsdp_config.get('activation_checkpointing', False)
act_ckpt_reentrant = fsdp_config.get(
'activation_checkpointing_reentrant', True)
if fsdp_config is not None and act_ckpt == True and act_ckpt_reentrant == False:
'activation_checkpointing_reentrant', False)
if fsdp_config is not None and act_ckpt == True and act_ckpt_reentrant == True:
warnings.warn(
'`te.Linear` layers do not support activation_checkpointing with '
+ '`activation_checkpointing_reentrant = False`. ' +
'Setting cfg.fsdp_config.activation_checkpointing_reentrant=True.'
+ '`activation_checkpointing_reentrant = True`. ' +
'Setting cfg.fsdp_config.activation_checkpointing_reentrant=False.'
)
cfg.fsdp_config.activation_checkpointing_reentrant = True
cfg.fsdp_config.activation_checkpointing_reentrant = False

if cfg.model.get('ffn_config', {}).get('ffn_type', 'mptmlp') == 'te_ln_mlp':
warnings.warn(
Expand Down

0 comments on commit b5fc0fa

Please sign in to comment.