Repository navigation
knowledge(vllm-omni): 1 change(s) from refine #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
knowledge/repos/vllm-omni/components/model-executor/rules-drama3-quant.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| title: "Drama 3 量化配置规则" | ||
| created: 2026-10-26 | ||
| updated: 2026-10-26 | ||
| type: rule | ||
| tags: [vllm-omni, components, model-executor] | ||
| sources: ["PR #9391"] | ||
| --- | ||
|
|
||
| # Drama 3 量化配置规则 | ||
|
|
||
| ## VLLM-OMNI-PR9391-DRAMA3-INT4 — Drama 3 hybrid INT4 量化必须解析期拒绝不支持形态,fused 层先展开 shard 再按 dense.targets 后缀分发 | ||
|
|
||
| - 触发:`vllm_omni/model_executor/models/fish_omni/quantization.py` 新增或修改模型专属量化注册(如 `drama3-int4` hybrid GPTQ)、experts/dense 分节量化或 per-prefix 量化分发,或改动与其共存的 NPU `bsgemm-moe`(`ExpertFp8Config`)路径;该 INT4 checkpoint 的文档口径是 CUDA SM80+(Ampere 及更新,A100 已验证)。 | ||
| - 强制:hybrid 格式以模型专属 method 名 `drama3-int4` 经 `register_quantization_config` 注册。`Drama3Int4Config.from_config` 必须在配置解析期以明确 `ValueError` 拒绝:顶层 `quant_method` 不是 `drama3-int4`;`bits` 不为 4、`sym` 为假或 `desc_act` 为真(非 symmetric 4-bit、无 activation ordering 的形态);缺 `group_size` 或缺 `dense.targets`;`experts.quant_method` 不是 `gptq`;`dense.quant_method` 不是 `gptq_marlin`。保证边界:`group_size` 与 `dense.targets` 只做存在性检查,不校验取值或 targets 内容;`sym` 是真值判断而非精确等于 `True`。`get_quant_method` 的分发不是直接拿原始 layer prefix 匹配:fused 层(`self_attn.qkv_proj`、`linear_attn.in_proj_qkvz`)先展开为各自 shard 名(对应 targets 中的 `self_attn.q_proj`/`k_proj`/`v_proj` 与 `linear_attn.in_proj_qkv`/`in_proj_z`),再逐个 shard 与 checkpoint `dense.targets` 做 `endswith` 匹配;非 fused prefix 直接做 `endswith`。命中返回量化 linear method(测试以 mock `AutoGPTQLinearMethod` 断言),未命中 prefix(如 `linear_attn.in_proj_ba`、`mlp.shared_expert.gate_up_proj`、`mlp.gate`)回退 `UnquantizedLinearMethod`(BF16)。NPU block-FP8(`bsgemm-moe`)配置保持独立。 | ||
| - 禁止:放宽 `from_config` 使 `bits=8`、`sym=False`、`desc_act=True`、experts 用 `awq`、dense 用普通 `gptq`、或缺 `group_size`/`dense.targets` 的变体通过;把格式错误推迟到权重加载或运行时才失败;跳过 fused 层的 shard 展开、只用未展开的 layer prefix 匹配(`qkv_proj`、`in_proj_qkvz` 将命中不了任何 target 而被错判为 BF16);量化任何未被 shard 展开后 `dense.targets` 后缀匹配覆盖的投影;让未命中 prefix 抛错而不是回退 BF16;把 CUDA INT4 与 NPU `bsgemm-moe` 合并成同一 config 或共用 method 名。 | ||
| - 验收:CPU 测试覆盖三点——`get_quantization_config('drama3-int4')` 解析到 `Drama3Int4Config`;逐 prefix 参数化断言量化/不量化,且必须包含 fused 层(`qkv_proj`、`in_proj_qkvz` 量化,`in_proj_ba` 不量化;mock `AutoGPTQLinearMethod`,未命中 target 断言 `UnquantizedLinearMethod`);对 `bits`/`sym`/`desc_act`/`group_size`/`dense.targets` 及顶层与 experts/dense 两节 `quant_method` 的变形 checkpoint 逐一断言 `ValueError` 及报错信息。既有 `bsgemm-moe` CPU 测试保持通过。^[PR #9391] | ||
|
|
||
| <!-- kb:rule status=active since=v0.30.0 --> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule exclusively governs
models/fish_omni/quantization.py, a model-specific checkpoint format, and its model-specific tests, but places the entire body under the shared model-executor component. RootAGENTS.mdexplicitly requires model-specific rules to stay with their model owner, and the component index itself excludes model-specific checkpoint logic. This also bypasses Direct's model discovery, which enumeratesmodels/*/rules.md, leaving no Drama 3 model rule entry for model-name routing. Put the rule under the corresponding model owner, update that owner's index, and retain only a routing link in the shared component if needed.AGENTS.md reference: AGENTS.md:L12-L14
Useful? React with 👍 / 👎.