[diffusion] multi-platform: use current_platform.device_type to replace hard-coded cuda device (#15232)
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
@@ -7,6 +7,8 @@ import numpy as np
|
||||
import torch
|
||||
import torch.distributed as dist
|
||||
|
||||
from sglang.multimodal_gen.runtime.platforms import current_platform
|
||||
|
||||
|
||||
def broadcast_pyobj(
|
||||
data: List[Any],
|
||||
@@ -20,7 +22,7 @@ def broadcast_pyobj(
|
||||
of dist_group argument).
|
||||
"""
|
||||
device = torch.device(
|
||||
"cuda" if torch.cuda.is_available() and not force_cpu_device else "cpu"
|
||||
current_platform.device_type if not force_cpu_device else "cpu"
|
||||
)
|
||||
|
||||
if rank == src:
|
||||
|
||||
Reference in New Issue
Block a user