Skip to content
cccskills
FreePublished on GitHub

quant-tuning-score-dit

Aggregate DiT inference outputs into per-dimension VBench metrics via AISBench. Run after the quant-tuning-evaluate DiT workflow produces a directory of mp4s and the user supplies a VBench-1.0-mini JSON + pre-populated cache dir. Single mode (Standard).

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

See how to install

Files included (6)

  • SKILL.md7.5 KB
  • references/aisbench_vbench.md7.6 KB
  • scripts/check_vbench_cache.py5.4 KB
  • scripts/patch_config.py8.4 KB
  • scripts/score.py21.8 KB
  • scripts/test_score_paths.py5.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Skill: DiT 调优评分(VBench)

对 quant-tuning-evaluate DiT 扩展节产出的 <subdir>/<idx:04d>.mp4 视频目录打分:通过 AISBench-VBench 1.0 给出逐维度分数 + Quality / Semantic / Total 加权总分;可选与 FP baseline 对比。

调用模式(重要)

本 Skill 是 tool/script,不是 subagent。

  • ✅ 调:execute python scripts/score.py --infer-outputs ... ...
  • ❌ 不能:Task(subagent_type="quant-tuning-score-dit", ...) —— "quant-tuning-score-dit" 是 skill 标识符,不是 subagent_type,不能塞进 Task 工具。走 Task 会撞「subagent_type 不在允许的清单内」错误。
  • 本文档下文里出现的「路由/委派/接手」等措辞是沿用 orchestrator 的术语,意思就是「orchestrator 在合适的时机 execute 调本 skill 的脚本」,不是真的起一个同名 subagent。

调用流程

orchestrator 每轮末按 model_family=dit 调本 Skill 的 score.py 脚本时:

1. 跑 scripts/check_vbench_cache.py
   ↓ 拿 candidates
   把 candidates 逐字呈现给用户,等用户确认
   ↓ 用户确认路径
2. 读 NPU 卡号(见下方"显卡配置") → 拼到命令前 → 跑 scripts/score.py ...
   ↓ JSON 输出
3. 把 ok/scores/overall_score 写进 history.yaml

显卡配置(NPU): VBench 打分需给 ais_bench 子进程指定 NPU 卡号。

  • 卡号取自现有流程:从 orchestrator 的 device_indices / history.yaml / run_manifest.json / 用户对话上下文里拿到当前轮次使用的物理卡号(如 [0] → "0")。不要凭空假设、不要 export 到环境变量里等子进程继承。

  • 直接拼在命令前(不是 export,不是写在脚本头部):

    ASCEND_RT_VISIBLE_DEVICES=0 python scripts/score.py \
        --infer-outputs ... --full-json-dir ... --vbench-cache-dir ...
    
  • 单卡优先(一般取 device_indices 的第一个值),避免多卡通信开销。

  • 如果拿不到卡号,先 npu-smi info 查一下,挑一张空闲卡。

transformers 版本兼容(NPU 场景): VBench 打分依赖的 AISBench 链路在 transformers >= 4.50 上可能不兼容;建议使用 < 4.50(如 4.42.3)。

  • 打分前:先检查当前 transformers 版本,若 >= 4.50 则临时降到 4.42.3(如 pip install transformers==4.42.3)。

  • 打分后:切回用户原本的版本(记下切换前的版本号,跑完恢复)。

  • 切换失败不勉强:装不上 / 切不回去都不要阻塞主流程,记一行 warning 后继续;只在真正触发 AISBench 兼容错误时才回头处理。

  • 推荐命令顺序:

    ORIG_VER=$(python -c "import transformers; print(transformers.__version__)")
    python -c "from packaging.version import Version; import transformers, sys; sys.exit(0 if Version(transformers.__version__) >= Version('4.50') else 1)" \
      && pip install transformers==4.42.3 || true
    
    ASCEND_RT_VISIBLE_DEVICES=0 python scripts/score.py ...
    
    pip install "transformers==${ORIG_VER}" || echo "warn: failed to restore transformers ${ORIG_VER}"
    

禁止跳过 precheck,禁止命中候选后静默选用第一条,禁止 ok=false 后未经授权下载。

CLI 契约

orchestrator 调本 skill 时,通过 execute 跑 scripts/score.py(脚本形式),例如:

python scripts/score.py \
    --infer-outputs     {workdir}/infer_outputs/round_N \
    --full-json-dir     <VBench_kmeans_info*.json> \
    --vbench-cache-dir  <用户提供的路径> \
    [--baseline-outputs {workdir}/baseline_outputs/round_N] \
    [--score-dimensions dim1,dim2,...] \
    [--max-num-workers N] \
    [--baseline-tolerance 0.05] \
    [--round N] \
    [--timeout-sec 7200] \
    [--output-json {workdir}/history/scores_round_N.json]

输出 shape(msagent-io v1):

{
  "protocol": "msagent.subagent_io",
  "subagent_type": "quant-tuning-score-dit",
  "status": "ok",
  "output": {
    "ok": true,
    "round": 2,
    "scorer": "vbench",
    "scores": {
      "subject_consistency": 0.842,
      "background_consistency": 0.913,
      "aesthetic_quality": 0.612,
      "motion_smoothness": 0.978
    },
    "quality_score": 76.4,
    "semantic_score": 0.0,
    "overall_score": 61.1,
    "loss_vs_baseline": 1.2,
    "is_satisfied": true,
    "baseline_overall_score": 59.9,
    "duration_sec": 1834.5,
    "commands": [{"name": "vbench_score", "command": "ais_bench ..."}],
    "inference_params": {  // 来自 {infer_outputs}/run_manifest.json(如有)
      "round": 2,
      "vbench_args": ["--task", "t2v-A14B", ...],
      "auto_env_overrides": {...}
    }
  }
}

失败时 status: failed、error.code 是稳定字符串(见 references/aisbench_vbench.md 错误码表)。退出码:ok → 0;failed → 2。

实现路径

score.py (单进程)
  ├─ patch_config.py     → 改写 AISBench 模板三处变量
  ├─ subprocess:         ais_bench <patched> --mode eval --max-num-workers N
  ├─ 解析 {work_dir}/results/{model_abbr}/vbench_<dim>.json
  ├─ 解析 summary/summary_*.txt 的 vbench_quality / semantic / total
  ├─ 可选: 同样的流程对 --baseline-outputs 再跑一次
  └─ 读 {infer_outputs}/run_manifest.json 填 inference_params

Quality / Semantic / Total 不本地重算——直接读 AISBench VBenchSummarizer 官方值。

AISBench 输出布局(自动识别)

不同 AISBench 版本 / 配置会把结果写到不同的目录布局,score.py 通过 _resolve_output_dirs(work_dir) 自动探测,按以下顺序匹配:

优先级布局触发条件
1{work_dir}/results/ + {work_dir}/summary/旧版配置或显式把 output_dir 重定向到 work 根
2{work_dir}/outputs/default/<latest-ts>/{results,summary}/AISBench 默认配置;多次跑会累积多个时间戳目录,取最新
✗—都不存在 → error.code = "AISBENCH_NO_OUTPUT"

两种布局并存时走优先级 1(路径更短、好排障)。回归覆盖见 scripts/test_score_paths.py(6 个用例)。

约束

  • 不下载权重:错误信息引导 orchestrator 跑 check_vbench_cache.py 把候选呈现给用户
  • 环境错误可定位:stderr 被分类为 ENV_DECORD_MISSING / ENV_DETECTRON2_MISSING / ENV_TORCH_MISSING / ENV_CUDA_MISMATCH 等,每条都附官方 doc URL:https://github.com/AISBench/benchmark/blob/master/docs/source_zh_cn/extended_benchmark/lmm_generate/vbench.md
  • 错误即停:评分失败立即回传 failed
  • 不修改 AISBench 上游:纯消费者
  • 错误码稳定:错误码字符串不能改

参考

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