Skip to content

Commit 69291d1

Browse files
committed
Fix another possible sync issues with fasttensors (for Windows)
1 parent e539f7c commit 69291d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

exllamav2/fasttensors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ def get_tensor(self,
213213
size = end - beg
214214
numel = size // esize
215215
shape = h["shape"]
216+
if device != "cpu":
217+
torch.cuda.set_stream(torch.cuda.default_stream(device))
216218
tensor = torch.zeros(shape, dtype = dtype, device = device)
217219
assert tensor.is_contiguous, "Non-contiguous tensor"
218220
ext_c.safetensors_read_fb(self.handle_fb, beg + self.header_size, size, tensor)

0 commit comments

Comments
 (0)