Unverified Commit ced84629 authored by wallen0322's avatar wallen0322 Committed by GitHub
Browse files

fix: ksampler error when the tensor is not contiguous #535 (#673)

* Update utils.py-fix [Bug] ksampler error #535

* Update utils.py

* Update linear.py-fix [Bug] ksampler error #535 New issue
parent 27c61936
......@@ -179,12 +179,12 @@ class SVDQW4A4Linear(nn.Module):
B: batch size, S: sequence length
"""
batch_size, seq_len, channels = x.shape
x = x.view(batch_size * seq_len, channels)
x = x.reshape(batch_size * seq_len, channels)
if output is None:
output = torch.empty(batch_size * seq_len, self.out_features, dtype=x.dtype, device=x.device)
quantized_x, ascales, lora_act_out = self.quantize(x)
output = self.forward_quant(quantized_x, ascales, lora_act_out, output)
output = output.view(batch_size, seq_len, -1)
output = output.reshape(batch_size, seq_len, -1)
return output
def quantize(self, x: torch.Tensor, pad_size: int = 256) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment