Browse Source

[example] gpt demo more accuracy tflops (#2178)

pull/2136/head
Jiarui Fang 2 years ago committed by GitHub
parent
commit
65f56f49e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      examples/language/gpt/train_gpt_demo.py

1
examples/language/gpt/train_gpt_demo.py

@ -283,6 +283,7 @@ def main():
optimizer.sync_grad()
optimizer.step()
logger.info(get_mem_info(prefix=f'[{n+1}/{NUM_STEPS}] Optimizer step '), ranks=[0])
torch.cuda.synchronize()
step_time = time() - start
logger.info(
f'[{n+1}/{NUM_STEPS}] Loss:{loss.item():.3f}, Step time: {step_time:.3f}s, TFLOPS: {get_tflops_func(step_time):.3f}',

Loading…
Cancel
Save