执行摘要
跳过 conch kernel 处理 g_idx 重排
Conch kernel 不支持 g_idx 重排,导致使用此功能的量化模型(如 LoRA 测试)在 ROCm 上失败。PR 作者指出问题非 ROCm 特有,但 CUDA 上因 kernel 选择顺序(Marlin 优先)而未被触发。详情见 PR body 中的链接。
小而精准的 bugfix,值得合并。对于全量量化模型用户,避免潜在无声错误。
无 review 评论。
Conch kernel 不支持 g_idx 重排,导致使用此功能的量化模型(如 LoRA 测试)在 ROCm 上失败。PR 作者指出问题非 ROCm 特有,但 CUDA 上因 kernel 选择顺序(Marlin 优先)而未被触发。详情见 PR body 中的链接。
小而精准的 bugfix,值得合并。对于全量量化模型用户,避免潜在无声错误。
无 review 评论。
在 vllm/model_executor/kernels/linear/mixed_precision/conch.py 的 ConchLinearKernel.can_implement 方法中,在检查 group_size 之后、检查 conch 安装之前,新增一个判断:如果 c.has_g_idx 为真,则返回 (False, "Activation reordering (g_idx) is not supported by ConchLinearKernel")。这样,当模型需要 g_idx 重排时,Conch 不会被选中,后续的 ExllamaLinearKernel(ROCm 上的下一个候选)将被使用。
| 文件 | 模块 | 状态 | 重要度 |
|---|---|---|---|
vllm/model_executor/kernels/linear/mixed_precision/conch.py |
内核选择 | modified | 5.66 |
vllm/model_executor/kernels/linear/mixed_precision/conch.py
data-contract
核心改动文件,在 can_implement 方法中新增 g_idx 支持判断。
# vllm/model_executor/kernels/linear/mixed_precision/conch.py
@classmethod
def can_implement(cls, c: MPLinearLayerConfig) -> tuple[bool, str | None]:
if c.weight_type not in _CONCH_SUPPORTED_WEIGHT_TYPES:
return False, f"Weight type ({c.weight_type}) not supported"
if c.group_size not in _CONCH_SUPPORTED_GROUP_SIZES:
return False, f"Group size ({c.group_size}) not supported"
# 新增:若配置要求 g_idx 重排,则不可用
if c.has_g_idx:
return (
False,
"Activation reordering (g_idx) is not supported by ConchLinearKernel",
)
if find_spec("conch") is None:
return False, "conch-triton-kernels is not installed"
return True, None
当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。
风险极低:仅新增一条条件判断,无破坏性。若 has_g_idx 属性存在且为 True 时正确跳过,其他情况行为不变。需确认 MPLinearLayerConfig 中 has_g_idx 字段是否存在(从代码看已在其他地方使用)。
影响范围限于使用 Conch kernel 且模型配置了 g_idx 重排的场景。修复了 LoRA 量化测试失败,对其他用户无影响。
当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。
参与讨论