Skip to content

Commit b262949

Browse files
authored
Fixing synchronization issue when non-zero GPU is used as a device (#113)
1 parent dd62281 commit b262949

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def device_sync(device):
1717
if "cuda" in device:
18-
torch.cuda.synchronize()
18+
torch.cuda.synchronize(device)
1919
elif "cpu" in device:
2020
pass
2121
else:

mixtral-moe/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def device_sync(device):
1717
if "cuda" in device:
18-
torch.cuda.synchronize()
18+
torch.cuda.synchronize(device)
1919
elif "cpu" in device:
2020
pass
2121
else:

0 commit comments

Comments
 (0)