MCPcopy
hub / github.com/EleutherAI/gpt-neox / log

Method log

megatron/utils.py:297–308  ·  view source on GitHub ↗

Log a group of timers.

(self, names, normalizer=1.0, reset=True)

Source from the content-addressed store, hash-verified

295 wandb.log({f"timers/{name}": value}, step=iteration)
296
297 def log(self, names, normalizer=1.0, reset=True):
298 """Log a group of timers."""
299 assert normalizer > 0.0
300 string = "time (ms)"
301 for name in names:
302 elapsed_time = self.timers[name].elapsed(reset=reset) * 1000.0 / normalizer
303 string += " | {}: {:.2f}".format(name, elapsed_time)
304 if torch.distributed.is_initialized():
305 if torch.distributed.get_rank() == 0:
306 print(string, flush=True)
307 else:
308 print(string, flush=True)
309
310
311def expand_attention_types(attention_config, num_layers):

Callers 6

pretrainFunction · 0.95
training_logFunction · 0.80
tb_wandb_logFunction · 0.80
writeMethod · 0.80
forwardMethod · 0.80

Calls 1

elapsedMethod · 0.80

Tested by

no test coverage detected