Repository navigation
Tensor Metrics 1: Add framework for training metrics - #6647
Merged
jaredcasper merged 2 commits intoSep 17, 2026
Merged
Conversation
|
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. |
Contributor
Author
|
/ok to test |
This was referenced Aug 19, 2026
philipcmonk
force-pushed
the
pmonk/tensor-metrics-framework
branch
from
August 19, 2026 02:45
8ba5c3f to
81a2fd3
Compare
Contributor
Author
|
/ok to test |
philipcmonk
force-pushed
the
pmonk/tensor-metrics-framework
branch
from
August 19, 2026 23:04
81a2fd3 to
4799b2f
Compare
Contributor
Author
|
/ok to test |
Signed-off-by: Philip Monk <pmonk@nvidia.com>
This was referenced Aug 27, 2026
philipcmonk
force-pushed
the
pmonk/tensor-metrics-framework
branch
from
September 16, 2026 01:26
4799b2f to
338e656
Compare
Contributor
|
/ok to test 3c13e61 |
jaredcasper
approved these changes
Sep 17, 2026
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/35230737749 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a general training metrics framework. This is a reimplementation and generalization of #5492, and it's split out of #6552.
There are dozens of metrics that we want to keep track of during training, and currently we have to thread each one separately through the model. This is bug-prone and delicate, and it multiplies the complexity of making other changes that affect the sharding of tensors.
Here, we add a system that decouples obtaining a tensor from the metric computation itself. This lets users easily add metrics without changes to MCore.
Check the committed README at megatron/training/tensor_metrics/README.md for an overview of the system and how to add metrics.
This is part 1 of a four-PR stack:
This PR contains only the authoring API, executor, documentation, and unit tests. It does not discover tensors, integrate with the training loop, register concrete metrics, or write logging results. Those pieces are added by later PRs in the stack.