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

Method _autotuning_exit

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

Source from the content-addressed store, hash-verified

3786 return self.engine_timers_cache
3787
3788 def _autotuning_exit(self):
3789 if self.global_rank == 0:
3790 msg = self.timers.get_mean([
3791 FORWARD_GLOBAL_TIMER,
3792 BACKWARD_GLOBAL_TIMER,
3793 STEP_GLOBAL_TIMER,
3794 ], reset=False)
3795 titer = 0.0
3796 titer += msg[FORWARD_GLOBAL_TIMER] if FORWARD_GLOBAL_TIMER in msg else 0
3797 titer += msg[BACKWARD_GLOBAL_TIMER] if BACKWARD_GLOBAL_TIMER in msg else 0
3798 titer += msg[STEP_GLOBAL_TIMER] if STEP_GLOBAL_TIMER in msg else 0
3799 titer *= self.gradient_accumulation_steps()
3800 msg["latency"] = titer
3801 msg["FLOPS_per_gpu"] = self.flops * 1_000_000 * self.gradient_accumulation_steps() / titer
3802 msg["throughput"] = self.train_batch_size() * 1_000_000 / \
3803 msg["latency"]
3804 print_json_dist(msg, [0], path=self.autotuning_metric_path())
3805 log_dist(
3806 f"Wrote metrics to {self.autotuning_metric_path()}, {os.path.abspath(self.autotuning_metric_path())}",
3807 ranks=[0])
3808 import atexit
3809 atexit.register(print, "Autotuning: done with running current ds config.")
3810 exit()
3811
3812 def _write_monitor(self):
3813 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