[CI] [ROCm] Fix tests/entrypoints/test_grpc_server.py on ROCm (#31970)

Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
This commit is contained in:
TJian
2026-01-09 12:54:20 +08:00
committed by GitHub
parent a1648c4045
commit 7a05d2dc65
5 changed files with 18 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ from packaging.version import Version, parse
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
from setuptools.command.build_py import build_py
from setuptools.command.develop import develop
from setuptools_scm import get_version
from torch.utils.cpp_extension import CUDA_HOME, ROCM_HOME
@@ -147,6 +148,14 @@ class BuildPyAndGenerateGrpc(build_py):
super().run()
class DevelopAndGenerateGrpc(develop):
"""Develop mode that also generates gRPC stubs from proto files."""
def run(self):
compile_grpc_protos()
super().run()
class CMakeExtension(Extension):
def __init__(self, name: str, cmake_lists_dir: str = ".", **kwa) -> None:
super().__init__(name, sources=[], py_limited_api=not is_freethreaded(), **kwa)
@@ -950,13 +959,17 @@ if _no_device():
ext_modules = []
if not ext_modules:
cmdclass = {"build_py": BuildPyAndGenerateGrpc}
cmdclass = {
"build_py": BuildPyAndGenerateGrpc,
"develop": DevelopAndGenerateGrpc,
}
else:
cmdclass = {
"build_ext": precompiled_build_ext
if envs.VLLM_USE_PRECOMPILED
else cmake_build_ext,
"build_py": BuildPyAndGenerateGrpc,
"develop": DevelopAndGenerateGrpc,
}
setup(