Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix arguments passed to compute_tflops #4642

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def train(
throughput = sample_processed / step_time
throughputs.append(throughput)

tflops_per_gpu = compute_tflops(throughput, num_params, world_size, batch_seqlen)
tflops_per_gpu = compute_tflops(args, sample_processed, step_time, dp_size)

if not total_steps % args.logging_freq and args.log_reduced_training_loss > 0:
loss_scalar = reduce_loss(loss)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def compute_tflops(args, global_batch_size, step_time, world_size):
# Based on
# https://github.com/NVIDIA/Megatron-LM/blob/ba773259dbe5735fbd91ca41e7f4ded60b335c52/megatron/training/training.py#L65
num_experts_routed_to = 1 if args.moe > 1 else args.num_experts_per_tok
if args.num_key_value_heads is None:
args.num_key_value_heads = args.num_heads
Comment on lines +40 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this internally as well

num_flops = (
12
* global_batch_size
Expand Down