Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhuach21 committed Jun 4, 2024
1 parent 4d528f3 commit 04a5149
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auto_round/autoround.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def quant_layer(self, layer_name, inputs, q_inputs=None, device=torch.device("cp
mse_loss = torch.nn.MSELoss().to(device)
scaler = self.get_scaler() # pylint: disable=assignment-from-none
init_loss = None
best_v, best_min_scale, best_max_scale = torch.tensor(0), torch.tensor(0), torch.tensor(0)
best_v, best_min_scale, best_max_scale = torch.tensor(0), torch.tensor(1.0), torch.tensor(1.0)
gradient_accumulate_steps = self.train_bs ##Force to low gpu
train_bs = 1 ##Force to low gpu
pick_samples = train_bs * gradient_accumulate_steps
Expand Down Expand Up @@ -861,7 +861,7 @@ def quant_block(self, block, input_ids, input_others, q_input=None, device=torch
mse_loss = torch.nn.MSELoss().to(device)
scaler = self.get_scaler() # pylint: disable=assignment-from-none
init_loss = None
best_v, best_min_scale, best_max_scale = torch.tensor(0), torch.tensor(0), torch.tensor(0)
best_v, best_min_scale, best_max_scale = torch.tensor(0), torch.tensor(1.0), torch.tensor(1.0)
for i in range(self.iters):
total_loss = 0
if self.sampler == "rand":
Expand Down

0 comments on commit 04a5149

Please sign in to comment.