mirror of
https://github.com/vladmandic/automatic
synced 2026-09-14 02:28:43 +02:00
SDNQ remove use_contiguous_mm path in re_quant
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import Tuple
|
||||
|
||||
import torch
|
||||
|
||||
from .common import dtype_dict, compile_func, use_contiguous_mm
|
||||
from .common import dtype_dict, compile_func
|
||||
from .packed_int import pack_int_symetric, unpack_int_symetric, pack_int_asymetric, unpack_int_asymetric
|
||||
|
||||
|
||||
@@ -51,11 +51,7 @@ def quantize_fp8(input: torch.FloatTensor, dim: int = -1) -> Tuple[torch.Tensor,
|
||||
def re_quantize_int8(weight: torch.FloatTensor) -> Tuple[torch.CharTensor, torch.FloatTensor]:
|
||||
if weight.ndim > 2: # convs
|
||||
weight = weight.flatten(1,-1)
|
||||
if use_contiguous_mm:
|
||||
weight, scale = quantize_int8(weight.t(), dim=0)
|
||||
else:
|
||||
weight, scale = quantize_int8(weight, dim=-1)
|
||||
weight, scale = weight.t_(), scale.t_()
|
||||
weight, scale = quantize_int8(weight.t(), dim=0)
|
||||
return weight, scale
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user