Skip to content

Conversation

@Codle
Copy link
Contributor

@Codle Codle commented May 3, 2022

In engine.py line 360 to 366, the codes want to print something in seconds:

  elapsed = self.timers('train_batch').elapsed(reset=True)
  iter_time = elapsed / self.steps_per_print()
  tput = self.train_batch_size() / iter_time
  print(f'steps: {self.global_steps} '
        f'loss: {self.agg_train_loss:0.4f} '
        f'iter time (s): {iter_time:0.3f} '
        f'samples/sec: {tput:0.3f}')

But in timer, it get elapsed time by _get_elapsed_msec method which returns time in msec.

def elapsed(self, reset=True):
"""Calculate the elapsed time."""
    started_ = self.started_
    # If the timing in progress, end it first.
    if self.started_:
        self.stop()
    # Get the elapsed time.
    elapsed_ = self._get_elapsed_msec()
    # Reset the elapsed time
    if reset:
        self.reset()
    # If timing was in progress, set it back.
    if started_:
        self.start()
    return elapsed_

@jeffra jeffra merged commit a3b9003 into deepspeedai:master May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants