MCPcopy Create free account
hub / github.com/THUDM/GLM / log

Method log

utils.py:168–176  ·  view source on GitHub ↗

Log a group of timers.

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

Source from the content-addressed store, hash-verified

166 return self.timers[name]
167
168 def log(self, names, normalizer=1.0, reset=True):
169 """Log a group of timers."""
170 assert normalizer > 0.0
171 string = 'time (ms)'
172 for name in names:
173 elapsed_time = self.timers[name].elapsed(
174 reset=reset) * 1000.0 / normalizer
175 string += ' | {}: {:.2f}'.format(name, elapsed_time)
176 print_rank_0(string)
177
178
179def report_memory(name):

Callers 4

finetuneFunction · 0.95
_trainFunction · 0.80
trainFunction · 0.80
forwardMethod · 0.80

Calls 2

print_rank_0Function · 0.85
elapsedMethod · 0.80

Tested by

no test coverage detected