horizonrobotics/oe-skills/lightcompress-quant-explore

Claude Code and agent skill by horizonrobotics/oe-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

执行 LightCompress 量化实验并生成精度报告。当用户要求运行量化实验、量化精度测试或 PPL 评估时触发。

Install

npx vskill@latest install horizonrobotics/oe-skills/lightcompress-quant-explore

SKILL.md

LightCompress 量化探索实验

执行流程(4 阶段)

Phase 1: 准备实验

调用 prepare_experiment.py 创建实验目录和 YAML 配置:

bash
python {skill_dir}/scripts/prepare_experiment.py \
--model /path/to/model \
--model-type Qwen2 \
--method smoothquant \
--w-bit 8 \
--a-bit 8
注意:不指定 --workspace 时,脚本默认使用 {当前工作目录}/experiments 作为输出目录。

脚本输出 JSON 包含:

  • experiment_dir: 实验目录路径
  • config_path: YAML 配置路径
  • yaml_content: 完整 YAML 配置内容
Phase 2: 用户确认

向用户展示完整的 YAML 配置内容,让用户检查是否符合预期。

使用 AskUserQuestion 询问:开始实验 / 取消

Phase 3: 执行实验

用户确认后,调用 execute_experiment.py 执行实验:

bash
python {skill_dir}/scripts/execute_experiment.py {experiment_dir}
Phase 4: 保存精度缓存

实验成功后,检查 <project_root>/.claude/skills/quant-accuracy-cache/ 是否存在:

  • 存在:调用 quant-accuracy-cache skill 保存结果
  • 不存在:跳过

参数说明

prepare_experiment.py 参数
参数必需说明默认值
--model✅模型路径-
--model-type✅模型类型-
--method✅量化方法-
--w-bit权重量化位宽4
--a-bit激活量化位宽8
--fast-mode快速验证模式false
--save-artifacts保存量化产物false
--workspace工作目录./experiments
--mix-bits混合精度组(可多次),见下方示例-
--special覆盖 quant.special 参数(可多次),KEY=VAL-
--calib-path校准数据集路径内置 wikitext2_calib
--calib-name校准数据集名wikitext2
--calib-n-samples校准样本数(显式值不被显存降级)自动
--calib-seq-len校准序列长度模板默认
--calib-preproc校准预处理wikitext2_gptq
--eval-path评估数据集路径内置 wikitext2_eval
--eval-seq-len评估序列长度模板默认
--no-eval-pretrain只评 fake_quant,跳过 pretrainfalse
--inference-per-block逐 block 推理评测(大模型省显存)false
--save-pathfakequant 保存路径(指定即开 save_fake)-
混合精度 (mix_bits) 示例

将 q/o_proj + MoE expert 设为 W4、其余 W8(Gemma4Moe 常用):

bash
python {skill_dir}/scripts/prepare_experiment.py \
--model /jfs-public/openexplorer_llm/models/gemma-4-26B-A4B-it \
--model-type Gemma4Moe --method gptq --w-bit 8 --a-bit 8 \
--mix-bits "name=qo_experts_w4;bit=4;layers=self_attn.q_proj,self_attn.o_proj,experts.experts.*.gate_proj,experts.experts.*.up_proj,experts.experts.*.down_proj" \
--calib-n-samples 256 --calib-seq-len 1024 \
--no-eval-pretrain --inference-per-block \
--save-path /path/to/save/ \
--env-activate ~/miniconda3/etc/profile.d/conda.sh
  • --mix-bits 格式:"name=组名;bit=位宽;layers=层1,层2,...",层名支持通配符 *(如 experts.experts.*.gate_proj)。多组混合精度可多次传 --mix-bits。
  • 未列入 mix_bits 的层使用全局 --w-bit 位宽。
支持的模型类型
模型系列type 值
QwenQwen, Qwen2, Qwen3, Qwen3Moe
InternVLInternVL2, InternVL3_5
DeepSeekDeepSeekV2, DeepSeekV3
Gemma4Gemma4, Gemma4Moe(MoE 自动识别 num_experts)

外部配置文件

文件用途
base_template.ymlYAML 模板
methods_config.yml量化方法参数
pretrain_accuracy_cache.ymlpretrain 缓存

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/horizonrobotics/oe-skills/lightcompress-quant-explore/badge)](https://verified-skill.com/skills/horizonrobotics/oe-skills/lightcompress-quant-explore)

Something wrong with this skill or its page? Tell us.