MCPcopy Index your code
hub / github.com/zai-org/CodeGeeX / write

Method write

codegeex/megatron/global_vars.py:248–256  ·  view source on GitHub ↗

Write timers to a tensorboard writer

(self, names, writer, iteration, normalizer=1.0, reset=False)

Source from the content-addressed store, hash-verified

246 return self.timers[name]
247
248 def write(self, names, writer, iteration, normalizer=1.0, reset=False):
249 """Write timers to a tensorboard writer"""
250 # currently when using add_scalars,
251 # torch.utils.add_scalars makes each timer its own run, which
252 # polutes the runs list, so we just add each as a scalar
253 assert normalizer > 0.0
254 for name in names:
255 value = self.timers[name].elapsed(reset=reset) / normalizer
256 writer.add_scalar(name + "-time", value, iteration)
257
258 def log(self, names, normalizer=1.0, reset=True):
259 """Log a group of timers."""

Callers 15

save_checkpointFunction · 0.45
training_logFunction · 0.45
dicts_to_jsonlFunction · 0.45
unsafe_executeFunction · 0.45
gather_outputFunction · 0.45
inspect_resultFunction · 0.45

Calls 1

elapsedMethod · 0.80

Tested by

no test coverage detected