执行摘要
移除无用量化代码和测试
PR body 仅标明移除死量化代码和测试。这样做可以减少代码库中无用的测试和已废弃的配置路径,避免误导开发者和 CI 资源浪费。
值得精读,可作为代码清理的理想范例:审慎移除标记为跳过或遗留的路径,保持代码库整洁。
无 review 讨论。sfeng33 快速批准。
PR body 仅标明移除死量化代码和测试。这样做可以减少代码库中无用的测试和已废弃的配置路径,避免误导开发者和 CI 资源浪费。
值得精读,可作为代码清理的理想范例:审慎移除标记为跳过或遗留的路径,保持代码库整洁。
无 review 讨论。sfeng33 快速批准。
tests/quantization/test_fp8.py 中已标记跳过的 KV_CACHE_MODELS 列表和 test_kv_cache_model_load_and_run 函数,这些测试依赖已被移除的 checkpoint。tests/quantization/fp_quant.py 文件,该文件测试已不再支持的 FPQuant 方法。tests/kernels/quantization/test_awq.py 中已标记跳过且需调查的 test_awq_gemm_opcheck 函数。vllm/model_executor/layers/quantization/fp8.py 中冗余的 if self.use_marlin 分支,该分支逻辑与后续统一调用相同。vllm/model_executor/layers/quantization/__init__.py 中删除 "auto-round": INCConfig 映射,该配置已在 INC 重构后废弃。| 文件 | 模块 | 状态 | 重要度 |
|---|---|---|---|
tests/quantization/test_fp8.py |
FP8 量化 | modified | 5.91 |
tests/quantization/fp_quant.py |
FP 量化 | removed | 5.29 |
tests/kernels/quantization/test_awq.py |
AWQ 量化 | modified | 4.89 |
vllm/model_executor/layers/quantization/fp8.py |
FP8 量化 | modified | 4.4 |
vllm/model_executor/layers/quantization/__init__.py |
量化注册 | modified | 4.16 |
vllm/model_executor/layers/quantization/fp8.py
core-logic
移除了 apply 方法中冗余的 if self.use_marlin 分支,简化了控制流。
# vllm/model_executor/layers/quantization/fp8.py (cleanup)
# 在 `apply` 方法尾部,去除了重复的 Marlin 分支
# ... 前置逻辑:dequant 到 BF16 并执行 GEMM
if weight_scale.dim() == 1 and weight_scale.shape[0] == weight_fp8.shape[0]:
weight_bf16 = weight_fp8 * weight_scale.unsqueeze(1)
else:
weight_bf16 = weight_fp8 * weight_scale
return torch.nn.functional.linear(x, weight_bf16.t(), bias)
# 移除了以下死分支:
# if self.use_marlin:
# return self.fp8_linear.apply_weights(layer, x, bias)
# 现在所有非 dequant 路径统一调用 :
return self.fp8_linear.apply_weights(layer, x, bias)
当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。
移除已标记跳过的测试和死分支风险很低。但需要注意:如果任何外部代码或自定义路径依赖了 __init__.py 中 auto-round 键或 fp8.py 中 use_marlin 标志,会引发配置错误。鉴于这些代码已被标记为废弃或跳过,影响面极小。
对用户无功能影响;对开发者减少了混淆,清洁了量化模块。CI 可能略微加速,因为移除了无用的测试数据加载。
当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。
参与讨论