Skip to content

Commit 2c67c96

Browse files
committed
support ray distributor executor on xpu
Signed-off-by: chzhang <[email protected]>
1 parent dd31580 commit 2c67c96

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

examples/offline_inference/rlhf_colocate.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ def __init__(self):
8080
self.model = AutoModelForCausalLM.from_pretrained("facebook/opt-125m")
8181
from vllm.platforms import current_platform
8282

83-
if current_platform.is_xpu():
84-
self.model.to("xpu:0")
85-
else:
86-
self.model.to("cuda:0")
83+
self.model.to(current_platform.device_type + ":0")
8784
# Zero out all the parameters.
8885
for name, p in self.model.named_parameters():
8986
p.data.zero_()

0 commit comments

Comments
 (0)