Skip to content

Ascend/msagent / skills/quantizer/msmodelslim-layer-wise-quantization

msmodelslim-layer-wise-quantization

Verified

为 msModelSlim 适配器实现逐层量化(按层加载/懒加载)能力。仅在用户明确要求逐层量化或基础适配因 CPU 内存不足无法全量加载权重时使用。该特性为高阶可选项,不是基础适配必需项。

references/workflow.md

View on GitHub
# 逐层量化工作流

用于在基础适配与四步验证通过后,开启按层加载量化路径。

## 阶段 A:确认是否需要启用

- 用户明确要求逐层量化/逐层加载/懒加载。
- 或 CPU 内存无法全量加载权重。
- 若不满足,保持基础适配流程,不进入本工作流。

## 阶段 B:逐层改造

1. 增加权重映射读取能力(`model.safetensors.index.json`)。
2. 增加按需读取单层权重能力(按 prefix 过滤)。
3. 增加缺层时的按层实例化与加载逻辑。
4. 统一 `generate_model_visit` 与 `generate_model_forward` 的层遍历来源,确保严格同序。

## 阶段 C:最小验证

1. 可完整遍历所有 decoder 层。
2. visit/forward 层序一一对应,无错位。
3. 抽样前向无 shape 断裂与异常。

## 验收规则

- 若阶段 B/C 全通过,可标记“逐层量化改造完成”。
- 若失败,回退到基础适配路径并记录阻塞点(层构造参数、键名映射、模块副作用等)。
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 193kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 193kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 193kUpdated Claude CodeCodexVerifiedInstall