Objective
Under the premise of satisfying the framework contract, migrate the model layer to MindSpeed-MM FSDP2 while preserving the source model semantics.
Applicable Scenarios
- The migration task requires creating a model plugin under
mindspeed_mm/fsdp/models/. - Need to add or fix
model_idregistration and ModelHub compatibility. - Need to adapt the model loading signature (
from_pretrained、_from_config)。
Inapplicable Scenarios
- The task is data preprocessing or dataloader behavior adjustment.
- The task involves only YAML mapping.
- The task is only validation-phase issue triage.
Input
- Source model entry file
- Target
model_id - Required special token behavior
- FSDP2 constraints in the target configuration
runtime_assets.model_path
Output
- Model plugin implementation
- Model migration checklist with pass/fail status
- Rationale for each "non-reuse change"
Required Check Items
- Registration contract:
@model_register.register("<model_id>")
- Construction contract:
from_pretrainedandModelArgumentscall chain compatible_from_configpath valid
- Semantic contract:
- When the source model requires special tokens, its processing flow must be preserved
- Perform embedding resize/init only when necessary
- Training contract:
- The forward path can receive trainer input and return
.loss
- The forward path can receive trainer input and return
Anti-Deviation Execution Protocol
- Must be completed before implementation:
- Verify that
runtime_assets.model_pathexists and is readable - Extract the signature pattern by comparing with the most similar case
- Verify that
- Must be produced after implementation:
model_contract_checklist.mdsignature_compat_report.md
- Stop on failure:
from_pretrainedor_from_configIf either is incompatible, subsequent stages are prohibited from continuing
Prohibited Actions
- Prohibited to write
from_pretrainedas a single-parameter signature only - Prohibited to determine compatibility solely by "reading the code"; call evidence must be provided
- Prohibited to modify token constants when token-id alignment has not been confirmed
- Prohibited to delete key post-processing logic of the source model without providing an equivalent replacement
Implementation Rules
- Prioritize reuse of source logic; adapt only when the framework contract is incompatible.
- The modification scope is limited to the model plugin area.
- Do not introduce external hard dependencies on the source repository package paths.
- Record the precise reason for each adaptation.
Exit Criteria
- The model can be constructed via ModelHub according to the target
model_id. - Loading signature conflicts have been resolved.
- All model-side checklist conclusions are supported by evidence.
Progressive Resources
checks/model-acceptance.mdchecks/model-contract-gates.mderrors/model-error-dictionary.mderrors/triage-severity.mdexamples/minimal-io.md
Read these files only when detailed criteria are needed for acceptance or error triage.