Skip to content

Commit 327a99c

Browse files
allenwang28Allen Wang
andauthored
Fixes the sd adapter in forge experiments (#1484)
Copied from github.com//pull/1441, tested manually via forge --------- Co-authored-by: Allen Wang <[email protected]>
1 parent 3aa09b9 commit 327a99c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torchtitan/experiments/forge/engine.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ def __init__(self, job_config: ForgeJobConfig):
215215
lr_schedulers=self.lr_schedulers,
216216
states={"train_state": self},
217217
checkpoint_config=job_config.checkpoint,
218-
sd_adapter=self.train_spec.state_dict_adapter,
218+
sd_adapter=(
219+
self.train_spec.state_dict_adapter(model_args)
220+
if self.train_spec.state_dict_adapter
221+
else None
222+
),
219223
)
220224

221225
loss_parallel_enabled = (

0 commit comments

Comments
 (0)