Skip to content

Commit

Permalink
Fix for weights-only load (pytorch#1228)
Browse files Browse the repository at this point in the history
stack-info: PR: pytorch#1228, branch: drisspg/stack/19
  • Loading branch information
drisspg authored and asahni04 committed Dec 5, 2024
1 parent 87a1e65 commit 9ec0edd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions test/prototype/test_low_bit_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,9 @@ def test_optim_bf16_stochastic_round_correctness(self):
optim2.step()
optim2.zero_grad()

torch.testing.assert_close(loss1, loss2, msg=lambda msg: f"Iteration {idx}. {msg}")

torch.testing.assert_close(
loss1, loss2, msg=lambda msg: f"Iteration {idx}. {msg}"
)


_FSDP_WORLD_SIZE = 2
Expand Down
12 changes: 6 additions & 6 deletions torchao/prototype/low_bit_optim/adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

class _AdamBase(Optimizer):
def __init__(
self,
params,
lr,
betas,
eps,
weight_decay,
self,
params,
lr,
betas,
eps,
weight_decay,
amsgrad,
*,
block_size,
Expand Down

0 comments on commit 9ec0edd

Please sign in to comment.