Skip to content

Commit 5590e28

Browse files
committed
move to device to support pipeline parallel
Signed-off-by: Kyle Sayers <[email protected]>
1 parent d37251a commit 5590e28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compressed_tensors/transform/factory/hadamard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def forward(self, value: Tensor) -> Tensor:
107107

108108
return (
109109
apply_transform_weight(
110-
weight.to(self._precision),
110+
weight.to(dtype=self._precision, device=value.device),
111111
value.to(self._precision),
112112
self.args.location,
113113
self.module_type,

src/compressed_tensors/transform/factory/matrix_multiply.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(
9494

9595
def forward(self, value: Tensor) -> Parameter:
9696
return apply_transform_weight(
97-
self.weight.to(self._precision),
97+
self.weight.to(dtype=self._precision, device=value.device),
9898
value.to(self._precision),
9999
self.args.location,
100100
self.module_type,
@@ -103,7 +103,7 @@ def forward(self, value: Tensor) -> Parameter:
103103
def right_inverse(self, value: Tensor) -> Tensor:
104104
inverse = high_precision_invert(self.weight)
105105
return apply_transform_weight(
106-
inverse.to(self._precision),
106+
inverse.to(dtype=self._precision, device=value.device),
107107
value.to(self._precision),
108108
self.args.location,
109109
self.module_type,

0 commit comments

Comments
 (0)