fix: Fixed the .item() crash on multi-element MTP loss tensors via a#2182
Open
singlaamitesh wants to merge 1 commit into
Open
fix: Fixed the .item() crash on multi-element MTP loss tensors via a#2182singlaamitesh wants to merge 1 commit into
.item() crash on multi-element MTP loss tensors via a#2182singlaamitesh wants to merge 1 commit into
Conversation
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.
Fixes #2131
Summary
Fixed the
.item()crash on multi-element MTP loss tensors via a newcp_utils.compute_mtp_losseshelper (per-layer list) used for the CI bounds check and logging; after self-review, also fixed a follow-on regression where the multi-layer path had dropped the aggregatetrain/mtp_losskey that existing dashboards/alerts depend on — it now always logs the mean asmtp_lossplus per-layermtp_loss_{i}keys when there's more than one MTP head.Changes
slime/backends/megatron_utils/model.pyslime/backends/megatron_utils/cp_utils.pytests/test_mtp_loss_logging.py.github/workflows/pr-test.ymlHow this was tested
Ran
go=github)](https://github.com/thudm/slime/pull/2053/checks)locally.