Skip to content

MFU tracking for inference#3856

Open
tdene wants to merge 6 commits intoNVIDIA:mainfrom
tdene:tde/mfu_tracking
Open

MFU tracking for inference#3856
tdene wants to merge 6 commits intoNVIDIA:mainfrom
tdene:tde/mfu_tracking

Conversation

@tdene
Copy link
Contributor

@tdene tdene commented Mar 13, 2026

What does this PR do ?

⚠️ For major changes (either in lines of code or in its impact), please make sure to first share a design doc with the team. If you're unsure what's the best way to do so, contact the @mcore-oncall.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

Code review

Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!

All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.

Step 1: Mark PR as "Ready for Review"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

Step 2: Final Review

For PRs that change megatron/core, once all expert reviewers have approved, the Final Review label is applied automatically and final reviewers are assigned.

For PRs outside megatron/core, this step is skipped.

Step 3: Approved

Once all required reviewers have approved, the Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

For MRs into `dev` branch The proposed review process for `dev` branch is under active discussion.

MRs are mergable after one approval by either eharper@nvidia.com or zijiey@nvidia.com.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 13, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@tdene tdene force-pushed the tde/mfu_tracking branch from 53d02d1 to a24c196 Compare March 13, 2026 12:58
@tdene tdene marked this pull request as ready for review March 16, 2026 03:19
@tdene tdene requested review from a team as code owners March 16, 2026 03:19
@svcnvidia-nemo-ci svcnvidia-nemo-ci requested a review from a team March 16, 2026 03:19
@svcnvidia-nemo-ci svcnvidia-nemo-ci added this to the Core 0.16 milestone Mar 16, 2026
@tdene
Copy link
Contributor Author

tdene commented Mar 16, 2026

/claude review

Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Two inline comments:

  1. Potential ZeroDivisionError in training.py: total_tps and e2e_tps don't guard against elapsed_time_per_iteration == 0, unlike the neighboring train_tps / inf_tps lines.

  2. Missing d_conv in from_args(): InferenceFLOPsConfig.d_conv is used in the conv1d FLOPs term but from_args never reads it from args, silently using the default of 4.

Also noting: none of the new modules (inference_flops.py, gpu_peak_flops.py, mfu_tracker.py) have unit tests. The pure-computation logic in InferenceFLOPsCalculator and MFUTracker would be straightforward to test and would catch regressions in the FLOPs formulas.

tdene and others added 2 commits March 16, 2026 14:51
Co-authored-by: Jorge Albericio <jalbericiola@nvidia.com>
@tdene tdene requested review from a team as code owners March 17, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants