Skip to content

Commit e539f7c

Browse files
committed
Fix another possible sync issues with fasttensors
1 parent d3fe9f2 commit e539f7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exllamav2/fasttensors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def get_tensor(self,
226226
offset = data_offsets[0] + self.header_size
227227
length = data_offsets[1] - data_offsets[0]
228228
assert np.prod(sh) * dts == length, f"Tensor shape doesn't match storage size: {key}"
229-
229+
if device != "cpu":
230+
torch.cuda.set_stream(torch.cuda.default_stream(device))
230231
tensor = torch.empty(sh, device = device, dtype = dtt)
231232
ext_c.safetensors_load(self.handle, tensor, offset, length)
232233

0 commit comments

Comments
 (0)