external-mindstudio-msmodelslim-model-adapt

Create a base Transformers model adapter for msModelSlim, including adapter creation, implementation of required interfaces, and documentation of the four-step validation process.

Last repository push
GitHub Stars
187
Forks
67
Issues / PRs
15

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-adapt" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-94a02bd8016464ba648420224ae38424ff6d7902178a9d9dba64063e2d0e8286. 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

Create a base Transformers model adapter for msModelSlim, including adapter creation, implementation of required interfaces, and documentation of the four-step validation process.

0 Downloads

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.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: external-mindstudio-msmodelslim-model-adapt
description: 为 msModelSlim 创建基础 Transformers 模型适配器(Model Adapter)。 包含创建适配器、实现必需接口及四步验证流程。
  适用:Decoder-only LLM、理解类 VLM(仅 LLM/text 部分)。 不适用:多模态生成模型(图像/视频/语音生成)、Encoder-only、非
  Transformers 架构。
original-name: model-adapt
synced-from: https://github.com/kali20gakki/mindstudio-skills
synced-date: '2026-05-26'
synced-commit: f6695da3cfa864a100db5a94f594b638aeff6389
license: UNKNOWN

msModelSlim 基础模型适配 Skill

本 Skill 指导如何为新模型创建基础适配器,使其跑通 W8A8/W4A16 量化流程。

适用范围

  • 支持:Decoder-only LLM、理解类 VLM(只处理文本/LLM 主干)
  • 不支持:多模态生成(如 Stable Diffusion/Flux/Wan)、Encoder-only、非 Transformers

核心工作流

1. 准备工作

  • 下载模型:建议使用 modelscope download 下载非权重文件。
    • 示例:modelscope download --model <org>/<model> --local_dir ./models/<name> --exclude '*.safetensors'
  • 分析模型:阅读 config.json 与 modeling_*.py,确认结构与实现。

2. 创建适配器

  • 使用模板:
    • LLM: assets/model_adapter_template.py
    • VLM: assets/vlm_model_adapter_template.py
  • 实现接口:实现 handle_dataset, init_model, generate_model_visit, generate_model_forward, enable_kv_cache。
  • 关键原则:
    • visit 与 forward 必须严格一致。
    • MoE 模型建议 unpack 为纯线性层。
    • 详见:适配器实现指南

3. 注册与安装

  • 在 config/config.ini 注册模型与入口,并执行 bash install.sh。
  • 详见:适配器注册指南

4. 验证适配器 (必需)

  • 必须执行四步验证:生成测试模型 -> 全回退量化 -> 校验全回退模型与浮点权重严格一致且可完整加载/保存 -> 验证实际量化流程正常(含描述文件规则校验)。
  • 详见:适配器验证指南

常用脚本

脚本位于 scripts/ 目录下:

  • scripts/step1_generate_test_model.py
  • scripts/step2_run_quantization.py
  • scripts/step3_verify_weights.py
  • scripts/step4_verify_quant_description.py

参考资料

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供了 msModelSlim 模型适配器的完整创建与四步验证流程,解决特定技术用户的实际工程需求
  • 适用范围描述清晰,区分了支持和不支持的模型类型
Trigger Precision85/100

Highlights

  • description 清晰说明了 Skill 的核心功能和适用范围,边界清晰
Structure and Standards75/100

Areas to improve

  • 缺少端到端示例 Reported severity: Minor

    文档结构清晰,但未提供一个完整的、可执行的端到端示例来演示整个适配器创建和验证过程。

    Recommendation: 建议补充一个具体模型的完整适配示例,帮助用户更好地理解和执行。

Highlights

  • 文档结构良好,包含适用范围、核心工作流、常用脚本和参考资料
Execution Reliability70/100

Areas to improve

  • 未提及异常处理机制 Reported severity: Minor

    虽然提供了详细的验证流程,但未提及在下载模型、分析结构或执行脚本过程中可能遇到的异常情况及处理方法。

    Recommendation: 建议在指南中加入常见错误的处理方法或提示用户注意潜在的执行风险。

Highlights

  • 强调了四步验证流程的重要性,确保适配器正确性
  • 提供了常用脚本的具体路径
Evidence Verifiability (mean of the first four)77/100

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.

  • Invoke commands or scripts

    Read the script and arguments first. Use ordinary privileges and a scoped directory; confirm installation or execution in your host tool.

    Mentioned in main document · lines 41
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

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

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.