prepare for sglang+verl (#10555)
Signed-off-by: lbk-sys <hello_lbk@163.com> Signed-off-by: libaokui <libaokui@hauwei.com> Co-authored-by: libaokui <libaokui@hauwei.com> Co-authored-by: Even Zhou <even.y.zhou@outlook.com>
This commit is contained in:
@@ -17,10 +17,18 @@ import torch
|
|||||||
from packaging import version
|
from packaging import version
|
||||||
from torch.multiprocessing import reductions
|
from torch.multiprocessing import reductions
|
||||||
|
|
||||||
|
from sglang.srt.utils import is_npu
|
||||||
|
|
||||||
|
_is_npu = is_npu()
|
||||||
|
|
||||||
|
|
||||||
def monkey_patch_torch_reductions():
|
def monkey_patch_torch_reductions():
|
||||||
"""Monkey patching before Torch https://github.com/pytorch/pytorch/pull/149248 is fixed"""
|
"""Monkey patching before Torch https://github.com/pytorch/pytorch/pull/149248 is fixed"""
|
||||||
|
|
||||||
|
# Currently, NPU does not support UUID. This has been temporarily commented out, with support expected in the fourth quarter.
|
||||||
|
if _is_npu:
|
||||||
|
return
|
||||||
|
|
||||||
if hasattr(reductions, "_reduce_tensor_original"):
|
if hasattr(reductions, "_reduce_tensor_original"):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user