Skip to content

Commit 7e15947

Browse files
committed
Fix possible sync issues with fasttensors
1 parent 42e1bae commit 7e15947

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exllamav2/fasttensors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ def get_tensor(self,
189189
out_dtype = None) -> torch.Tensor:
190190
global global_tensorcache
191191

192+
torch.cuda.synchronize()
193+
192194
if self.tensor_remap and (not_fast or not self.fast):
193195
key = self.tensor_remap[key]
194196

@@ -236,4 +238,6 @@ def get_tensor(self,
236238
global_tensorcache = global_tensorcache[1:]
237239
global_tensorcache.append((cachekey, tensor))
238240

241+
torch.cuda.synchronize()
242+
239243
return tensor

0 commit comments

Comments
 (0)