mindspeed-fsdp2-model-migration
用于模型侧迁移到 MindSpeed-MM FSDP2 注册与加载契约。适用于实现模型插件、加载签名兼容、token/embedding 更新与前向兼容时。
How do I install this agent skill?
npx skills add https://github.com/ascend/agent-skills --skill mindspeed-fsdp2-model-migrationIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides a structured framework for migrating AI models to the MindSpeed-MM FSDP2 framework. It includes model registration protocols, adaptation guidelines, and validation checklists. While the instructions are focused on vendor-specific infrastructure, the process involves reading and acting upon external source code, which introduces a potential surface for indirect prompt injection. No malicious code or exfiltration patterns were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
MindSpeed FSDP2 模型迁移
目标
在满足框架契约的前提下,将模型层迁移到 MindSpeed-MM FSDP2,并保持源模型语义。
适用场景
- 迁移任务需要在
mindspeed_mm/fsdp/models/下创建模型插件。 - 需要新增或修复
model_id注册及 ModelHub 兼容性。 - 需要适配模型加载签名(
from_pretrained、_from_config)。
不适用场景
- 任务是数据预处理或 dataloader 行为调整。
- 任务仅涉及 YAML 映射。
- 任务仅为验证阶段问题分诊。
输入
- 源模型入口文件
- 目标
model_id - 必需的特殊 token 行为
- 目标配置中的 FSDP2 约束
runtime_assets.model_path
输出
- 模型插件实现
- 带通过/失败状态的模型迁移检查清单
- 每一处“非复用改动”的理由说明
必检项
- 注册契约:
@model_register.register("<model_id>")
- 构建契约:
from_pretrained与ModelArguments调用链兼容_from_config路径有效
- 语义契约:
- 源模型需要特殊 token 时,必须保留其处理流程
- 仅在必要时进行 embedding resize/init
- 训练契约:
- 前向路径可接收 trainer 输入并返回
.loss
- 前向路径可接收 trainer 输入并返回
防偏差执行协议
- 实施前必须完成:
- 校验
runtime_assets.model_path存在且可读 - 对照最相似案例抽取签名模式
- 校验
- 实施后必须产出:
model_contract_checklist.mdsignature_compat_report.md
- 失败即停止:
from_pretrained或_from_config任一不兼容,禁止继续后续阶段
禁止行为
- 禁止把
from_pretrained写成仅单参数签名 - 禁止仅靠“代码阅读”判定兼容,必须给调用证据
- 禁止在未确认 token-id 对齐时修改 token 常量
- 禁止删除源模型关键后处理逻辑而不给出等价替代
实施规则
- 优先复用源逻辑;仅在框架契约不兼容时做适配。
- 修改范围仅限模型插件区域。
- 不引入对源仓包路径的外部硬依赖。
- 记录每项适配的精确原因。
退出标准
- 模型可通过 ModelHub 按目标
model_id构建。 - 加载签名冲突已解决。
- 模型侧清单结论均有证据支撑。
渐进式资源
checks/model-acceptance.mdchecks/model-contract-gates.mderrors/model-error-dictionary.mderrors/triage-severity.mdexamples/minimal-io.md
仅在验收或错误分诊需要详细判据时读取这些文件。
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/ascend/agent-skills/mindspeed-fsdp2-model-migration">View mindspeed-fsdp2-model-migration on skillZs</a>