mirror of https://github.com/hpcaitech/ColossalAI
[example] gpt demo more accuracy tflops (#2178)
parent
ab54fed292
commit
65f56f49e8
|
@ -283,6 +283,7 @@ def main():
|
||||||
optimizer.sync_grad()
|
optimizer.sync_grad()
|
||||||
optimizer.step()
|
optimizer.step()
|
||||||
logger.info(get_mem_info(prefix=f'[{n+1}/{NUM_STEPS}] Optimizer step '), ranks=[0])
|
logger.info(get_mem_info(prefix=f'[{n+1}/{NUM_STEPS}] Optimizer step '), ranks=[0])
|
||||||
|
torch.cuda.synchronize()
|
||||||
step_time = time() - start
|
step_time = time() - start
|
||||||
logger.info(
|
logger.info(
|
||||||
f'[{n+1}/{NUM_STEPS}] Loss:{loss.item():.3f}, Step time: {step_time:.3f}s, TFLOPS: {get_tflops_func(step_time):.3f}',
|
f'[{n+1}/{NUM_STEPS}] Loss:{loss.item():.3f}, Step time: {step_time:.3f}s, TFLOPS: {get_tflops_func(step_time):.3f}',
|
||||||
|
|
Loading…
Reference in New Issue