mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-05-12 17:53:03 +00:00
[devops] remove post commit ci (#5566)
* [devops] remove post commit ci * [misc] run pre-commit on all files * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -74,9 +74,7 @@ def exam_state_dict(shard: bool, model_name: str, size_per_shard: int, test_conf
|
||||
data = data_gen_fn()
|
||||
model.train()
|
||||
if booster.plugin.stage_manager is not None:
|
||||
booster.execute_pipeline(
|
||||
_preprocess_data(data), model, _criterion, optimizer, return_loss=True
|
||||
)
|
||||
booster.execute_pipeline(_preprocess_data(data), model, _criterion, optimizer, return_loss=True)
|
||||
else:
|
||||
output = model(**_preprocess_data(data))
|
||||
loss = criterion(output)
|
||||
@@ -108,9 +106,7 @@ def exam_state_dict(shard: bool, model_name: str, size_per_shard: int, test_conf
|
||||
data_for_shard = data_gen_fn()
|
||||
data_for_origin = data_gen_fn()
|
||||
if booster.plugin.stage_manager is not None:
|
||||
booster.execute_pipeline(
|
||||
_preprocess_data(data_for_shard), model, _criterion, optimizer, return_loss=True
|
||||
)
|
||||
booster.execute_pipeline(_preprocess_data(data_for_shard), model, _criterion, optimizer, return_loss=True)
|
||||
booster.execute_pipeline(
|
||||
_preprocess_data(data_for_origin),
|
||||
new_model,
|
||||
|
||||
@@ -113,6 +113,7 @@ def check_torch_fsdp_ckpt():
|
||||
full_osd = FSDP.full_optim_state_dict(optimizer.unwrap_model().unwrap(), optim=optimizer)
|
||||
|
||||
import copy
|
||||
|
||||
sharded_osd = copy.deepcopy(full_osd)
|
||||
|
||||
run_model()
|
||||
|
||||
Reference in New Issue
Block a user