[NPU]DeepSeek-V3.2 support npu mlaprolog (#15381)
Co-authored-by: Zhengda Qin <zhengdqin@gmail.com> Co-authored-by: richhuan <huan_rz@qq.com>
This commit is contained in:
co-authored by
Zhengda Qin
richhuan
parent
738b1ac988
commit
b56366f827
@@ -93,8 +93,14 @@ class NPUW8A8Int8DynamicLinearMethod(_NPULinearMethodBase):
|
||||
x: torch.Tensor,
|
||||
bias: Optional[torch.Tensor] = None,
|
||||
) -> torch.Tensor:
|
||||
original_dtype = x.dtype
|
||||
quant_out, dynamic_scale = torch.ops.npu.npu_dynamic_quant(x)
|
||||
|
||||
if isinstance(x, tuple):
|
||||
"""dynamic_scale is calculated in malprolog kernel"""
|
||||
original_dtype = torch.bfloat16
|
||||
quant_out, dynamic_scale = x
|
||||
else:
|
||||
original_dtype = x.dtype
|
||||
quant_out, dynamic_scale = torch.ops.npu.npu_dynamic_quant(x)
|
||||
return torch.ops.npu.npu_quant_matmul(
|
||||
quant_out,
|
||||
layer.weight,
|
||||
|
||||
Reference in New Issue
Block a user