MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / log

Method log

deepspeed/utils/timer.py:131–140  ·  view source on GitHub ↗

Log a group of timers.

(self, names, normalizer=1.0, reset=True, memory_breakdown=False, ranks=None)

Source from the content-addressed store, hash-verified

129 return " | {} | {} | {} | {}".format(alloc, max_alloc, cache, max_cache)
130
131 def log(self, names, normalizer=1.0, reset=True, memory_breakdown=False, ranks=None):
132 """Log a group of timers."""
133 assert normalizer > 0.0
134 string = f"rank={dist.get_rank()} time (ms)"
135 for name in names:
136 if name in self.timers:
137 elapsed_time = (self.timers[name].elapsed(reset=reset) / normalizer)
138 string += " | {}: {:.2f}".format(name, elapsed_time)
139
140 log_dist(string, ranks=ranks or [0])
141
142 def get_mean(self, names, normalizer=1.0, reset=True):
143 """Get the mean of a group of timers."""

Callers 2

log_distFunction · 0.45
convert_sizeFunction · 0.45

Calls 3

log_distFunction · 0.90
get_rankMethod · 0.45
elapsedMethod · 0.45

Tested by

no test coverage detected