MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _autotuning_exit

Method _autotuning_exit

deepspeed/runtime/engine.py:3870–3892  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3868 return self.engine_timers_cache
3869
3870 def _autotuning_exit(self):
3871 if self.global_rank == 0:
3872 msg = self.timers.get_mean([
3873 FORWARD_GLOBAL_TIMER,
3874 BACKWARD_GLOBAL_TIMER,
3875 STEP_GLOBAL_TIMER,
3876 ], reset=False)
3877 titer = 0.0
3878 titer += msg[FORWARD_GLOBAL_TIMER] if FORWARD_GLOBAL_TIMER in msg else 0
3879 titer += msg[BACKWARD_GLOBAL_TIMER] if BACKWARD_GLOBAL_TIMER in msg else 0
3880 titer += msg[STEP_GLOBAL_TIMER] if STEP_GLOBAL_TIMER in msg else 0
3881 titer *= self.gradient_accumulation_steps()
3882 msg["latency"] = titer
3883 msg["FLOPS_per_gpu"] = self.flops * 1_000_000 * self.gradient_accumulation_steps() / titer
3884 msg["throughput"] = self.train_batch_size() * 1_000_000 / \
3885 msg["latency"]
3886 print_json_dist(msg, [0], path=self.autotuning_metric_path())
3887 log_dist(
3888 f"Wrote metrics to {self.autotuning_metric_path()}, {os.path.abspath(self.autotuning_metric_path())}",
3889 ranks=[0])
3890 import atexit
3891 atexit.register(print, "Autotuning: done with running current ds config.")
3892 exit()
3893
3894 def _write_monitor(self):
3895 if self.global_rank == 0:

Callers 1

stepMethod · 0.95

Calls 7

train_batch_sizeMethod · 0.95
print_json_distFunction · 0.90
log_distFunction · 0.90
registerMethod · 0.80
get_meanMethod · 0.45

Tested by

no test coverage detected