MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / save_checkpoint_and_time

Function save_checkpoint_and_time

codegeex/megatron/training.py:870–879  ·  view source on GitHub ↗
(iteration, model, optimizer, lr_scheduler)

Source from the content-addressed store, hash-verified

868
869
870def save_checkpoint_and_time(iteration, model, optimizer, lr_scheduler):
871 timers = get_timers()
872 # Extra barrier is added to make sure
873 # all ranks report the max time.
874 torch.distributed.barrier()
875 timers("save-checkpoint").start()
876 save_checkpoint(iteration, model, optimizer, lr_scheduler)
877 torch.distributed.barrier()
878 timers("save-checkpoint").stop()
879 timers.log(["save-checkpoint"])
880
881
882def train(

Callers 1

trainFunction · 0.85

Calls 5

get_timersFunction · 0.90
save_checkpointFunction · 0.90
startMethod · 0.80
stopMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected