Skip to content

fix(megatron): forward mtp_shared_weights to megatron-bridge - #10025

Merged
tastelikefeet merged 1 commit into
modelscope:mainfrom
Excelius-Wang:fix/mtp-shared-weights
Sep 1, 2026
Merged

fix(megatron): forward mtp_shared_weights to megatron-bridge#10025
tastelikefeet merged 1 commit into
modelscope:mainfrom
Excelius-Wang:fix/mtp-shared-weights

Conversation

@Excelius-Wang

Copy link
Copy Markdown
Contributor

What does this PR do?

Forward mtp_shared_weights to mtp_use_repeated_layer when using the megatron-bridge backend.

The default mcore-bridge backend already consumes the same-name field in mcore_bridge.ModelConfig; this patch covers the provider path, where automatic name matching cannot see the renamed field.

Why is this needed?

With --mtp_num_layers N --mtp_shared_weights true, megatron-bridge previously left mtp_use_repeated_layer=False, so it built independent MTP layers instead of one repeated layer.

The mapping is applied only when the opt-in flag is true, so model-specific provider defaults remain unchanged when it is disabled.

Testing

  • Added a CPU/mock regression test.
  • Covered opt-in mapping, disabled-flag behavior, and preservation of provider defaults.
  • Verified the mapped provider override and model attachment.
  • compileall, Flake8, YAPF, and git diff --check pass.

Related to #9936

@tastelikefeet
tastelikefeet merged commit 2884c7f into modelscope:main Sep 1, 2026
2 of 3 checks passed
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.

2 participants