Skip to content
cccskills
FreePublished on GitHub

quant-tuning-quantize

执行模型量化。通过 msmodelslim quant 依据 Practice YAML 对模型进行量化。

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md4.9 KB
  • references/error_handling.md2.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Skill: Quant Tuning Quantize

Overview

解决什么:依据 Practice YAML 配置,调用 msmodelslim quant 执行模型量化。

不解决什么:

  • 不生成/修改 Practice YAML → 见 quant-tuning-practice-generator Agent
  • 不执行评测 → 见 quant-tuning-evaluator Agent
  • 不做策略决策 → 见 quantization-accuracy-tuning-orchestrator Skill

执行主体:msmodelslim quant(execute 调用,以 exit code 判定成败)


协作关系

quantization-accuracy-tuning-orchestrator (workflow)
        │
        ▼ 调用
quant-tuning-quantize (tool)
        │
        ▼ CLI
  msmodelslim quant
        │
        ▼ 输出
  量化后的模型权重

执行步骤

┌─────────────────┐
│ 输入检查        │
│ - practice_path │
│ - model_path    │
│ - save_path     │
└────────┬────────┘
         ▼
┌─────────────────┐
│ 参数校验        │
│ 路径存在且可读   │
└────────┬────────┘
         ▼
┌─────────────────┐
│ execute:        │
│ msmodelslim quant│
└────────┬────────┘
         ▼
┌─────────────────┐
│ 结果处理        │
│ - 检查 exit code │
│ - 记录产物路径   │
│ - 错误上报       │
└─────────────────┘

输入参数

参数类型必需说明
config_pathstring✅Practice YAML 路径
model_pathstring✅原始模型路径
save_pathstring✅量化产物保存路径;须体现调优轮次,推荐 {workdir}/round_{N}/quantized(如 round_1/quantized)
model_typestring✅模型类型名
devicestring✅设备类型,如 npu:0
trust_remote_codebool❌是否信任远程代码

CLI 调用

msmodelslim quant \
  --model_path "${MODEL_PATH}" \
  --save_path "${WORKDIR}/round_1/quantized" \
  --device npu:0 \
  --model_type "${MODEL_TYPE}" \
  --config_path "${CONFIG_PATH}" \
  --trust_remote_code False

save_path 必须包含轮次与产物目录层级,便于 orchestrator 区分各轮权重,例如 {workdir}/round_1/quantized、{workdir}/round_2/quantized。

成功判定:exit code 为 0,且 ${SAVE_PATH} 下出现量化权重产物。

错误处理

错误类型处理
msmodelslim 未安装按 prepare_environment.md 安装后重试
路径不存在检查路径后重试或中止
量化失败报 stderr 摘要,等待 orchestrator 决策
超时按 Agent execution_timeout 处理,不上层续跑

输出结果

成功

向 orchestrator 回显:

量化完成:
- 产物路径: /workspace/output/round_1/quantized  (与 `--save_path` 一致,须含 round_N/quantized)
- 耗时: (可选)

失败

立即中止,回显命令名与 stderr 关键摘要,不续跑其它命令。


磁盘管理

  • 量化产物写入 save_path
  • 由 orchestrator 管理磁盘空间(最多保留 2 份权重)
  • 本 skill 不主动清理历史产物

约束

  • 错误即停:命令失败后立即中止,不兜底续跑
  • 单轮单次:每次调用只执行一次量化
  • config_path 模式:调优闭环使用 --config_path,与 --quant_type 互斥
  • save_path 命名:每轮使用 {workdir}/round_{N}/quantized,N 为当前调优轮次(如 round_1/quantized)
  • device:优先使用单卡,即以 --device npu:0/--device npu:3 这种入参形式

常见错误

错误原因解决
practice.yaml not found配置文件不存在检查 config_path
out of memory设备内存不足换设备

若错误不在上述常见错误中或者多次解决后依然未解决,依据错误上报,按照错误上报格式返回至 orchestrator。


检查清单

  • config_path 指向的 Practice YAML 已通过校验
  • device 格式正确(如 npu:0, npu:0,1,2,3),优先使用单卡
  • save_path 为 {workdir}/round_{N}/quantized 形式且磁盘空间充足
  • msmodelslim quant --help 可正常执行

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

当用户直接要求进行数据集压缩测评,或在量化调优过程中需要使用 AISBench 评测工具输出数据集精度等场景时使用。 本 Skill 负责:使用 AISBench 数据集压缩代码、用 RBF Kernel Herding 算法生成压缩后的数据子集(coreset),并按用户目标交付两种产物之一: ① 接入量化调优主流程:产出独立的 coreset 数据集配置(不覆盖原始数据),回传「全集 config_name + coreset config_name」给编排层,供 evaluation.yaml 切换; ② 仅数据集压缩测评(不做量化调优):基于 example 模板生成「全集测试脚本」和「子集测试脚本」两份 shell 脚本。 暂时支持 AIME 2025 和 GPQA,其他数据集需要再结合 aisbench tools目录下 herding_coreset_selector 源码进行分析。

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 19, 2026

Ascend cluster comparison tool. Invoke when user asks to compare two cluster datasets (DB or TEXT), or to generate cluster_analysis_output from raw profiling data via msprof-analyze and then compare.

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 19, 2026

专门用于 Ascend 集群 Profiling 性能数据的“快慢卡”诊断专家技能。当用户提供【集群性能数据目录/路径】并要求分析【快慢卡】、【慢节点】、【负载不均衡】或【集群瓶颈】时,必须触发此技能。该技能会自动接收集群路径,调度相关工具输出快慢卡的宏观定性与微观根因(如 Host 下发瓶颈、算子计算劣化)。

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 19, 2026

Analyze Ascend NPU collective communication profiling data with a DB-first workflow. Use when the user provides `cluster_analysis_output/cluster_analysis.db`, rank-level `analysis.db`, rank-level `ascend_pytorch_profiler_{rank_id}.db`, together with `profiler_info.json`, and asks about HCCL or hcom communication cost, collective communication TOP ops, wait time, slow rank/straggler, Notify Wait, bandwidth, retry, relay, SDMA/RDMA/HCCS links, communication matrix, or Ascend communication fault patterns.

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 19, 2026

Analyze Ascend NPU computation-side profiling data for single-card runs or a selected rank from multi-card runs. Use this skill when the user asks to diagnose computation bottlenecks, AI Core / AI Vector / AICPU hotspots, dynamic shape overhead, block dim issues, redundant TransData/Transpose/Cast, cross-stream waits, frequency/runtime-state issues, or fusion opportunities.

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 19, 2026

针对昇腾 NPU 上的 PyTorch 模型,识别可做融合算子替换的代码段、替换为 torch_npu 融合算子并做性能/精度验证。当用户提到融合算子、NPU 算子替换、RMSNorm/SwiGLU/RoPE/Attention 融合、torch_npu 亲和算子等关键词是,使用本 Skill。

The English summary is being prepared. Showing the original description.

kali20gakki/msAgent32Updated Oct 19, 2026

See all skills by kali20gakki

Report a problem with this skill