Skip to content
cccskills
FreePublished on GitHub

quant-tuning-evaluate

执行模型测评(统一入口)。LLM/VLM 走主流程 scripts/run_evaluation.py + Evaluation YAML;model_family=dit 走 DiT 扩展节(references/dit/evaluate_workflow.md,vbench.py 批量推理产出视频)。

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

See how to install

Files included (5)

  • SKILL.md7.9 KB
  • references/dataset_mapping.md1.3 KB
  • references/dit/evaluate_workflow.md19.7 KB
  • references/error_handling.md2.4 KB
  • scripts/run_evaluation.py4.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Skill: Quant Tuning Evaluate

Overview

解决什么:依据 Evaluation YAML 配置,通过 scripts/run_evaluation.py 对量化模型进行评测。

不解决什么:

  • 不生成/修改 Evaluation YAML → 见 quant-tuning-evaluation-generator Agent
  • 不执行量化 → 见 quant-tuning-quantizer Agent
  • 不做策略决策 → 见 quantization-accuracy-tuning-orchestrator Skill

执行主体:scripts/run_evaluation.py(LLM/VLM 主流程;DiT 路径执行主体为 references/dit/evaluate_workflow.md §3 bash 模板)

按 model_family 分发

orchestrator 委派本 skill 时按分析结论的 model_family 分发:

  • llm / vlm_text:走本文主流程(Evaluation YAML + run_evaluation.py 服务化评测,产出结构化分数)
  • dit:不进入主流程,走 DiT 扩展节 → references/dit/evaluate_workflow.md(读推理仓 README 拼 vbench.py argv,批量推理产出视频 + run_manifest.json,不评分;评分由 quant-tuning-score-dit 接力)

协作关系

quantization-accuracy-tuning-orchestrator (workflow)
        │
        ▼ 调用
quant-tuning-evaluate (tool)
        │
        ▼ Script
  run_evaluation.py
        │
        ▼ 输出
  评测结果 (精度分数)

执行步骤

┌─────────────────┐
│ 输入检查        │
│ - config_path   │
│ (Evaluation YAML)│
└────────┬────────┘
         ▼
┌─────────────────┐
│ 服务启动检查    │
│ - 检查 vLLM     │
│   是否就绪      │
└────────┬────────┘
         ▼
┌─────────────────┐
│ execute:        │
│ run_evaluation  │
│ .py             │
│ (启动推理服务   │
│  + 执行评测)    │
└────────┬────────┘
         ▼
┌─────────────────┐
│ 结果处理        │
│ - 解析精度分数   │
│ - 检查是否达标   │
│ - 错误上报       │
└─────────────────┘

输入参数

参数类型必需说明
quant_model_pathstring✅量化后模型路径
evaluate_idstring✅本轮评测 ID
evaluate_config_pathstring✅Evaluation YAML 路径(编排层常称 config_path)
save_pathstring✅评测工作目录
devicestring❌设备类型,默认 npu
device_indiceslist[int]❌设备索引列表,如 [0,1]

脚本调用

python skills/quantizer/quant-tuning-evaluate/scripts/run_evaluation.py \
  --quant-model-path /path/to/quantized \
  --evaluate-id eval-round-1 \
  --evaluate-config-path /path/to/evaluate.yaml \
  --save-path /path/to/workdir \
  --device npu \
  --device-indices 0,1

错误处理

错误类型处理
msmodelslim 未安装按 prepare_environment.md 安装
推理服务启动失败检查端口占用、设备可用性
评测超时检查 aisbench.timeout 配置
精度不达标正常返回结果,由 orchestrator 决策

输出结果

成功

{
  "ok": true,
  "results": {
    "gsm8k": {
      "score": 83.5,
      "target": 83.0,
      "passed": true
    },
    "aime25": {
      "score": 52.0,
      "target": 50.0,
      "passed": true
    }
  },
  "overall_passed": true,
  "duration": 1800.5
}

失败

{
  "ok": false,
  "error": "推理服务启动失败",
  "error_code": "INFERENCE_ERROR",
  "partial_results": {}
}

执行流程

1. 服务启动

调用 scripts/run_evaluation.py(execute)

2. 结果解析

返回每个数据集的分数:

字段说明
score实际精度(百分比)
target目标精度
passed是否达标(score >= target - tolerance)
overall_passed所有数据集是否都达标

run_evaluation.py 必须在调用公共 emit_result() 前使用 Pydantic JSON 模式序列化 EvaluateResult。禁止直接返回 model_dump() 的 Python 模式结果,因为其中的 Decimal(如 accuracy、target、tolerance)无法由标准 json.dumps() 序列化。JSON 模式会将十进制值无损转换为字符串;下游通过 EvaluateResult.model_validate() 读取时会恢复为 Decimal。


执行示例

标准调用

python skills/quantizer/quant-tuning-evaluate/scripts/run_evaluation.py \
  --quant-model-path /workspace/output/round_1/quantized \
  --evaluate-id round-1 \
  --evaluate-config-path /workspace/output/evaluate.yaml \
  --save-path /workspace/output \
  --device npu \
  --device-indices 0,1

结果返回给 orchestrator

评测完成:
- gsm8k: 83.5% (目标: 83.0%) ✅
- aime25: 52.0% (目标: 50.0%) ✅
- 总体: 达标
- 耗时: 1800.5s

约束

  • Script-only:禁止用裸 CLI 替代 run_evaluation.py
  • 路径格式:必须是 JSON 字符串
  • 单轮单次:每次调用只执行一次完整评测
  • 禁止派生或修改评测配置:只能按编排层给定的 evaluate_config_path 执行评测,不得自行派生、修改或生成新的 Evaluation YAML。子集不达标时 fast-fail 跳过后序数据集属正常行为,按原样回传结果,由编排层决策后续流程。评测配置仅由编排层 evaluation-generator 生成。
  • 服务生命周期:由脚本内部评测服务管理。如果你需要测多个数据集,请你在测完所有数据集后再关闭服务化,避免重复多次拉起。服务化测评运行时长可能较长,超过 timeout 3600s,务必避免在测评的中途关闭服务化和测评,你应该等待测评完成,必要时可以通过看日志(如vllm_server.log)最新的消息时间来确认测评任务是否还活跃。

常见错误

错误原因解决
port already in use端口被占用更换端口或等待释放
HCCL init failedNPU 通信失败检查 device_indices 和设备状态
evaluate.yaml not found配置文件不存在检查 config_path
out of memory设备内存不足换设备
Object of type Decimal is not JSON serializable使用了 Python 模式 model_dump()改用 model_dump(mode="json"),且不得重新执行已完成的评测

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


检查清单

  • config_path 指向的 Evaluation YAML 格式正确
  • device 与 device_indices 匹配
  • YAML 中的 ASCEND_RT_VISIBLE_DEVICES 与 device_indices 一致
  • device_indices 长度与 tensor-parallel-size 对齐
  • 目标端口未被占用
  • NPU/GPU 设备可用
  • msmodelslim 已安装
  • 成功结果可被标准 json.dumps() 序列化,并可由 EvaluateResult.model_validate() 重新读取

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