Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
horheynm committed Jul 10, 2024
1 parent 778b5b5 commit bc08e8d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ def compress(
dead = torch.diag(self.H) == 0
self.H[dead, dead] = 1
W[:, dead] = 0

g_idx = None
if hasattr(self.layer, "quantization_scheme"):
quant_scheme = self.layer.quantization_scheme
actorder = quant_scheme.weights.actorder

if actorder:
group_size = quant_scheme.weights.group_size
perm = torch.argsort(torch.diag(self.H), descending=True)
Expand All @@ -116,15 +116,15 @@ def compress(
)
g_idx = g_idx[invperm]
self.layer.weight_g_idx.data = g_idx

Losses = torch.zeros(self.rows, device=self.dev)

damp = percdamp * torch.mean(torch.diag(self.H))
diag = torch.arange(self.columns, device=self.dev)
self.H[diag, diag] += damp
self.H = torch.linalg.cholesky(self.H)
self.H = torch.cholesky_inverse(self.H)
self.H = torch.linalg.cholesky(self.H, upper=True)
self.H = torch.linalg.cholesky(self.H, upper=True)
Hinv = self.H

# See section 3.4 of https://arxiv.org/abs/2203.07259
Expand Down

0 comments on commit bc08e8d

Please sign in to comment.