Skip to content

fix(mtp): support multi-head MTP loss logging (mtp-num-layers > 1)#2132

Draft
ZiyiTsang wants to merge 1 commit into
THUDM:mainfrom
ZiyiTsang:fix/mtp-multilhead-logging
Draft

fix(mtp): support multi-head MTP loss logging (mtp-num-layers > 1)#2132
ZiyiTsang wants to merge 1 commit into
THUDM:mainfrom
ZiyiTsang:fix/mtp-multilhead-logging

Conversation

@ZiyiTsang

Copy link
Copy Markdown

Quick Fix for issue #2131.
Support multi-head MTP loss logging (mtp-num-layers > 1).

slime's per-step MTP-loss logging called .item() on tracker["values"], which is a [num_mtp_layers] vector from Megatron's MTPLossLoggingHelper. This crashes for any multi-head MTP model (--mtp-num-layers > 1) under --enable-mtp-training with: RuntimeError: a Tensor with N elements cannot be converted to Scalar. Align with Megatron's track_mtp_metrics: keep the per-layer vector and log one scalar per layer plus a summed total.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant