Skip to content

Commit e184357

Browse files
committed
replacing torch.cuda.set_device with
1 parent 8960b96 commit e184357

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def _validate_device_config(self):
320320
f"Detected KIND_GPU model instance, explicitly setting GPU device={triton_device_id} for {triton_instance}"
321321
)
322322
# vLLM doesn't currently (v0.4.2) expose device selection in the APIs
323-
torch.cuda.set_device(triton_device_id)
323+
os.environ["CUDA_VISIBLE_DEVICES"] = str(triton_device_id)
324324

325325
def _setup_lora(self):
326326
self.enable_lora = False

0 commit comments

Comments
 (0)