From 02f15b28cc1dc02aa7c615a1ecdb0d96083f02fc Mon Sep 17 00:00:00 2001 From: Disty0 Date: Mon, 26 May 2025 15:57:17 +0300 Subject: [PATCH] Cleanup --- modules/model_quant_sdnq.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/model_quant_sdnq.py b/modules/model_quant_sdnq.py index dd088bc33..57727ee14 100644 --- a/modules/model_quant_sdnq.py +++ b/modules/model_quant_sdnq.py @@ -414,15 +414,15 @@ def decompress_symmetric(input: torch.Tensor, scale: torch.Tensor, dtype: torch. return result -def decompress_int4_asymmetric(input: torch.Tensor, scale: torch.Tensor, zero_point: torch.Tensor, shape: torch.Size, dtype: torch.dtype, result_shape: torch.Size, skip_int8_matmul: bool = False) -> torch.Tensor: +def decompress_int4_asymmetric(input: torch.Tensor, scale: torch.Tensor, zero_point: torch.Tensor, shape: torch.Size, dtype: torch.dtype, result_shape: torch.Size) -> torch.Tensor: + return decompress_asymmetric(unpack_uint4(input, shape), scale, zero_point, dtype, result_shape) + + +def decompress_int4_symmetric(input: torch.Tensor, scale: torch.Tensor, shape: torch.Size, dtype: torch.dtype, result_shape: torch.Size, skip_int8_matmul: bool = False) -> torch.Tensor: if skip_int8_matmul: - return decompress_asymmetric(unpack_uint4(input, shape), scale.unsqueeze(-1), zero_point, dtype, result_shape) + return decompress_symmetric(unpack_int4(input, shape, dtype=scale.dtype), scale.unsqueeze(-1), dtype, result_shape) else: - return decompress_asymmetric(unpack_uint4(input, shape), scale, zero_point, dtype, result_shape) - - -def decompress_int4_symmetric(input: torch.Tensor, scale: torch.Tensor, shape: torch.Size, dtype: torch.dtype, result_shape: torch.Size) -> torch.Tensor: - return decompress_symmetric(unpack_int4(input, shape, dtype=scale.dtype), scale, dtype, result_shape) + return decompress_symmetric(unpack_int4(input, shape, dtype=scale.dtype), scale, dtype, result_shape) def pack_uint4(tensor: torch.Tensor) -> torch.Tensor: