Skip to content

fix: avoid in-place mutation of param in MTP weight conversion (related to #2131)#2227

Open
botbikamordehai2-sketch wants to merge 1 commit into
THUDM:mainfrom
botbikamordehai2-sketch:fix/issue-2131-1784632320
Open

fix: avoid in-place mutation of param in MTP weight conversion (related to #2131)#2227
botbikamordehai2-sketch wants to merge 1 commit into
THUDM:mainfrom
botbikamordehai2-sketch:fix/issue-2131-1784632320

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

In convert_mimo_mtp_param, when handling eh_proj.weight, the param tensor is reassigned after chunking and concatenating halves. While this does not cause a crash in the conversion logic, it mutates the tensor's storage if the original param is later used elsewhere (e.g., in other conversion calls). The reported crash #2131 is actually in training-step logging for multi-head MTP, not in this conversion file. However, this commit fixes a minor potential issue in the conversion code to avoid unexpected behavior from in-place modification.

Fix

Ensure the new tensor created by torch.cat is contiguous to avoid potential issues with non-contiguous memory views.

Closes #2131

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.

[Bug] Multi-head MTP (--mtp-num-layers > 1) crashes at training-step logging

1 participant