external-mindstudio-msmodelslim-model-analysis
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "external-mindstudio-msmodelslim-model-analysis" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ee136ef286c74e4be2d3902aeb0a50e551b0bf56629a63fbbb59724ea81cc3cb. Verify the upstream source and version against https://github.com/ascend-ai-coding/awesome-ascend-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Analyzes candidate models before implementing adapters: determine the model source (Transformers or model zoo), structural characteristics, whether layerwise loading is required, and risks for MoE fused weights. Intended for use when users consult on adapter feasibility or perform pre-adaptation analysis.
Introduction source: third_party · ascend-ai-coding · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: external-mindstudio-msmodelslim-model-analysis
description: 在实现适配器前对候选模型做分析。确定模型实现来源(transformers 或模型目录)、结构特征、是否需逐层加载及 MoE 融合权重风险。适用于用户询问模型适配可行性或做适配前分析时使用。
original-name: model-analysis
synced-from: https://github.com/kali20gakki/mindstudio-skills
synced-date: '2026-05-26'
synced-commit: f6695da3cfa864a100db5a94f594b638aeff6389
license: UNKNOWN模型分析 Skill
适用范围
- 支持:
- Decoder-only LLM
- VLM 文本主干分析(仅 LLM/文本路径)
- 不支持:
- 既非 transformers 也非模型目录内
modeling_*.py的实现 - 多模态生成模型(图像/视频/语音生成)
- 既非 transformers 也非模型目录内
必需输入
- 模型路径或模型仓库标识
config.json- 可选:模型目录内
modeling_*.py、model.safetensors.index.json - 若本地缺少上述文件,先补齐输入:
- 使用
modelscope download --model <org>/<model> --local_dir ./models/<name> --exclude '*.safetensors'下载非权重文件。 - 在下载目录中读取
config.json与modeling_*.py,作为后续分析输入。
- 使用
硬门禁:先解析实现来源
在进行任何结构分析前必须完成。Agent 应按以下步骤手动解析,无需脚本:
-
读取
config.json:- 获取
model_type - 获取
auto_map(如有)
- 获取
-
尝试从 transformers 解析实现:
- 检查
transformers库是否支持该model_type。 - 检查路径:
transformers/models/<model_type>/modeling_<model_type>.py是否存在。 - 如果存在,记录为
transformers实现。
- 检查
-
若未解析到,尝试模型目录内实现:
- 检查
auto_map指向的文件是否存在于模型目录。 - 检查模型目录内是否有
modeling_*.py文件。 - 如果存在,记录为
model-local实现。
- 检查
-
若两种路径均不可用:
- 停止分析。
- 要求用户提供可读的模型实现代码。
最小工作流
- 解析实现来源(完成上述硬门禁)。
- 判断模型类型、结构差异与连接关系:
- 类型:纯 LLM / 多模态理解模型 / 多模态生成模型
- 对比常见 Qwen2 类 LLM,记录特殊结构设计(如 MoE、非标准 attention、SSM/混合块、额外头部或并行分支)
- 检查特殊结构连接关系(接入位置、前后依赖、串联/并联/残差连接、是否影响主干遍历)
- 识别结构特征:
- decoder 层类、attention/MLP 模块命名、forward 签名
- 确定影响适配的特征:
- 层遍历路径与顺序
- 是否需要逐层加载
- MoE 融合专家权重风险
- 量化模型反量化脚本风险
- MTP 结构实现可得性与权重处理风险
- 产出结构化分析结果(参考下方模板)。
- 给出后续动作:
- 进入
model-adapt-core - 或阻塞并说明需用户提供的内容
- 进入
模型类型、结构差异与连接关系判定(相对常见 Qwen2)
纯 LLM:仅文本 token 输入,主干为 decoder-only 语言模型。多模态理解模型:含视觉/音频等编码器,但生成路径以文本主干为核心,允许仅分析并适配文本部分。多模态生成模型:核心目标是图像/视频/语音生成,当前流程不支持,应直接阻塞并说明原因。- 结构差异只需记录“是否存在 + 影响方向”,不要求深入实现细节。
- 连接关系至少记录:特殊结构位于主干的哪个阶段、与哪些模块相连、连接方式(串联/并联/残差)及对遍历/forward 对齐的影响。
MoE 布局判定
MoE 非融合:专家按模块/列表展开(常见为每个 expert 各自持有gate/up/down线性层)。MoE 融合:多个 expert 的权重被打包为张量参数,不再是一组独立线性层。- 若看到
gate/up/down中任一或多项以[..., num_experts, ...]或[num_experts, ...]形式存储,应按“融合”处理。 - 对三维专家权重(如 gate/up/down 分别融合成 3D 参数)统一归类为
MoE 融合,并在报告中标注“可能需要 unpack”。
必需输出:分析报告
Agent 应直接生成分析报告(Markdown 格式),内容必须包含以下要素。请参考下方模板:
# 分析报告
## 模型标识
- 模型路径/仓库:{model_path}
- `model_type`:{model_type}
- `architectures`:{architectures}
## 实现来源解析
- 结果:`transformers` | `model-local` | `unsupported`
- 依据:
- 解析到的文件路径:{path}
- 相关配置字段(`model_type`、`auto_map`):{details}
## 模型特征与规格
- Hidden size:{hidden_size}
- 层数:{num_layers}
- Attention heads / KV heads:{num_heads} / {num_kv_heads}
- 是否仅分析 VLM 文本部分:是/否
## 模型类型、结构差异与连接关系
- 模型类型:纯 LLM | 多模态理解模型 | 多模态生成模型
- 相对常见 Qwen2 的特殊结构:{special_structures}
- 特殊结构连接关系:{special_structure_connections}
- 对适配流程的影响:{structure_impact}
## 逐层加载评估
- 是否需要逐层加载:是/否
- 理由:{reason}
- 约束(内存/运行环境):{constraints}
## MoE 评估
- 是否含 MoE:是/否
- 布局类型:无 MoE | MoE 非融合 | MoE 融合
- 疑似融合的键/模块:{keys}
- 专家权重形态:独立线性层 | 打包张量(含 3D 专家权重)
- 是否需要 unpack:是/否
## 适配影响要点
- Decoder 遍历路径:{traversal_path}
- Attention 模块命名:{attn_module}
- MLP 模块命名:{mlp_module}
- `visit/forward` 严格对齐点:{alignment_points}
## 量化与 MTP 风险评估
- 模型是否已量化:是/否
- 量化判定依据:{quant_evidence}
- 是否已提供反量化脚本:是/否
- 反量化脚本状态说明:{dequant_status}
- 是否存在 MTP 结构:是/否
- MTP 实现代码可获取性:可获取/不可获取
- MTP 风险说明:{mtp_risk}
## 风险与后续动作
- 风险等级:低 | 中 | 高
- 阻塞项:{blockers}
- 建议下一步:
- 进入 `model-adapt-core`
- 或要求用户提供实现代码
风险识别与用户沟通要求(必须执行)
- 若识别为“模型本身已量化”,必须将“缺少反量化脚本”标记为阻塞项,并明确要求用户主动提供反量化脚本后再继续适配。
- 若识别到存在 MTP 结构但无法获取其实现代码,必须明确告知:
- Agent 可能无法完整实现 MTP 结构适配;
- 如需继续,用户需要自行复制 MTP 相关权重(按用户侧已有实现进行映射)。
- 上述两类风险至少有一项命中时,
风险等级不得低于“中”。
通过/失败标准
- 通过:实现来源为
transformers或model-local,模型类型为纯 LLM 或多模态理解模型,且报告完整;若命中量化/MTP 风险,已在报告中给出明确用户动作要求。 - 失败:来源未解析、为不支持的实现类型、判定为多模态生成模型,或命中“量化模型但无反量化脚本”阻塞条件。
参考
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 面向模型适配前的技术可行性分析,解决关键决策问题
- 在目标用户群体(进行模型适配的开发者)中具有高实用价值
Highlights
- description 明确描述使用场景,边界清晰
- 适用范围和必需输入定义完整
Areas to improve
-
引用文件缺失 Reported severity: Minor
SKILL.md 中引用了 [分析检查清单](references/analysis_checklist.md),但未在传入文件中提供该引用文件
Recommendation: 请补充 references/analysis_checklist.md 文件或移除该引用
Highlights
- 文档结构完整,有清晰的适用范围、必需输入、硬门禁、最小工作流、输出模板、通过/失败标准
- 步骤划分明确,提供了详细的分析报告模板作为端到端示例
- frontmatter 完整,单文件长度符合规范
Highlights
- 工具来源明确(transformers库、modelscope download),参数使用正确
- 覆盖了主要异常情况(如实现来源无法解析、多模态生成模型不支持、量化模型缺少反量化脚本等)
- 对不可逆操作有明确的确认和阻塞机制
- MoE融合判定逻辑清晰
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.