Skip to content

feat(decision): single source of head mount names + head_state_prefixes for the merge strip - #388

Merged
tastelikefeet merged 1 commit into
modelscope:dev-swift-v5from
z0o0ey:dev-swift-v5
Nov 17, 2026
Merged

tastelikefeet merged 1 commit into
modelscope:dev-swift-v5from
z0o0ey:dev-swift-v5

Conversation

@z0o0ey

@z0o0ey z0o0ey commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

HEAD_MODULE_NAMES ('task_head', 'scoring_head') becomes the one definition of the dual mount: attach_transformers / attach_megatron loop over it and reactivate matches every name instead of hardcoding prefixes.

head_state_prefixes(model) reports which mounts a model actually carries (legacy single-mount checkpoints -> ('scoring_head',), headless -> ()), unioning Megatron chunks; merge / export code strips head keys from a merged state dict through it.

state_dict() emits a key under every mounted name (named_parameters deduplicates shared modules by identity, state_dict does not), so the strip must filter on the whole tuple, never a single prefix.

Experiment results

Paste your experiment result here(if needed).

…for the merge strip

HEAD_MODULE_NAMES ('task_head', 'scoring_head') becomes the one definition of the
dual mount: attach_transformers / attach_megatron loop over it and reactivate
matches every name instead of hardcoding prefixes.

head_state_prefixes(model) reports which mounts a model actually carries (legacy
single-mount checkpoints -> ('scoring_head',), headless -> ()), unioning Megatron
chunks; merge / export code strips head keys from a merged state dict through it.

state_dict() emits a key under every mounted name (named_parameters deduplicates
shared modules by identity, state_dict does not), so the strip must filter on the
whole tuple, never a single prefix.
@tastelikefeet
tastelikefeet merged commit e19a23a into modelscope:dev-swift-v5 Nov 17, 2026
0 of 5 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