MCPcopy
hub / github.com/zai-org/CogView / log

Method log

utils.py:132–140  ·  view source on GitHub ↗

Log a group of timers.

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

Source from the content-addressed store, hash-verified

130 return self.timers[name]
131
132 def log(self, names, normalizer=1.0, reset=True):
133 """Log a group of timers."""
134 assert normalizer > 0.0
135 string = 'time (ms)'
136 for name in names:
137 elapsed_time = self.timers[name].elapsed(
138 reset=reset) * 1000.0 / normalizer
139 string += ' | {}: {:.2f}'.format(name, elapsed_time)
140 print_rank_0(string)
141
142
143def report_memory(name):

Callers 7

trainFunction · 0.80
filling_sequenceFunction · 0.80
inverse_prompt_scoreFunction · 0.80
forward_Method · 0.80
gumbel_softmaxFunction · 0.80
forwardMethod · 0.80
sparse_attentionFunction · 0.80

Calls 2

print_rank_0Function · 0.85
elapsedMethod · 0.80

Tested by

no test coverage detected