MCPcopy Index your code
hub / github.com/THUDM/GLM / get_checkpoint_name

Function get_checkpoint_name

utils.py:194–202  ·  view source on GitHub ↗
(checkpoints_path, iteration, release=False, zero=False)

Source from the content-addressed store, hash-verified

192
193
194def get_checkpoint_name(checkpoints_path, iteration, release=False, zero=False):
195 if release:
196 d = 'release'
197 else:
198 d = '{}'.format(iteration)
199 if zero:
200 dp_rank = mpu.get_data_parallel_rank()
201 d += '_zero_dp_rank_{}'.format(dp_rank)
202 return os.path.join(checkpoints_path, d, 'mp_rank_{:02d}_model_states.pt'.format(mpu.get_model_parallel_rank()))
203
204
205def ensure_directory_exists(filename):

Callers 4

load_pretrainedFunction · 0.90
save_zero_checkpointFunction · 0.85
save_checkpointFunction · 0.85
load_checkpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected