[AMD] Add triton awq_dequantize kernel to support AWQ on ROCm (#7661)

This commit is contained in:
Hubert Lu
2025-07-18 14:27:25 -07:00
committed by GitHub
parent c8f31042a8
commit 7750b91ca8
5 changed files with 530 additions and 3 deletions
+5 -1
View File
@@ -127,6 +127,10 @@ if _is_cuda:
)
elif _is_cpu and _is_cpu_amx_available:
pass
elif _is_hip:
from sglang.srt.layers.quantization.awq_triton import (
awq_dequantize_triton as awq_dequantize,
)
else:
from vllm._custom_ops import awq_dequantize
@@ -2176,7 +2180,7 @@ class DeepseekV2ForCausalLM(nn.Module):
)
if hasattr(self_attn.kv_b_proj, "qweight"):
# AWQ compatible
if _is_cuda:
if _is_cuda or _is_hip:
w = awq_dequantize(
self_attn.kv_b_proj.qweight,
self_attn.kv_b_proj.scales,