Skip to content

Commit 0cf0188

Browse files
committed
make new weight on cpu
Signed-off-by: Kyle Sayers <[email protected]>
1 parent a7bb2e2 commit 0cf0188

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/llmcompressor/modeling/fuse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def fuse_norm_linears(norm: torch.nn.Module, linears: Iterable[torch.nn.Linear])
5151

5252
update_offload_parameter(linear, "weight", new_weight)
5353

54-
update_offload_parameter(norm, "weight", torch.ones_like(norm.weight))
54+
new_norm_weight = torch.ones_like(norm.weight, device="cpu")
55+
update_offload_parameter(norm, "weight", new_norm_weight)
5556

5657
else:
5758
raise ValueError(f"Cannot fuse norm of type {type(norm)}")

0 commit comments

Comments
 (0)