From 46095f0551ec99d579402a65ad7a7c6b595f6a37 Mon Sep 17 00:00:00 2001 From: R0CKSTAR Date: Sun, 1 Feb 2026 04:02:39 +0800 Subject: [PATCH] [MUSA] Update 3rd party dir to build/_deps (#18035) Signed-off-by: Xiaodong Ye --- .gitignore | 5 ----- sgl-kernel/setup_musa.py | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index be89e031c..00d145ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -272,11 +272,6 @@ python/sglang/srt/grpc/*_pb2.pyi sgl-kernel/csrc_musa/ sgl-kernel/include_musa/ sgl-kernel/csrc/**/*_musa/ -sgl-kernel/third_party/*/csrc_musa/ -sgl-kernel/third_party/*/include_musa/ - -# Third-party libraries source code -sgl-kernel/third_party/ # MUSA core dump files *.mudmp diff --git a/sgl-kernel/setup_musa.py b/sgl-kernel/setup_musa.py index a1df4d90f..b000f5f14 100644 --- a/sgl-kernel/setup_musa.py +++ b/sgl-kernel/setup_musa.py @@ -28,7 +28,7 @@ from setuptools import find_packages, setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension root = Path(__file__).parent.resolve() -third_party = Path("third_party") +third_party = Path(os.environ.get("SGLANG_MUSA_THIRD_PARTY_DIR", "build/_deps")) arch = platform.machine().lower() @@ -160,7 +160,7 @@ class _CustomBuildExt(BuildExtension): @staticmethod def _clone_and_checkout(repo_path, repo_url, git_tag, git_shallow): """Clone a git repository and checkout a specific tag/commit.""" - repo_path.parent.mkdir(exist_ok=True) + repo_path.parent.mkdir(parents=True, exist_ok=True) if not repo_path.exists(): clone_cmd = ["git", "clone"] if git_shallow: @@ -173,8 +173,10 @@ class _CustomBuildExt(BuildExtension): subprocess.check_call(["git", "checkout", git_tag], cwd=repo_path) def run(self): - if os.environ.get("SKIP_THIRD_PARTY", "0") == "1": - print("Skipping third-party repositories cloning (SKIP_THIRD_PARTY=1)") + if os.environ.get("SGLANG_MUSA_SKIP_THIRD_PARTY", "0") == "1": + print( + "Skipping third-party repositories cloning (SGLANG_MUSA_SKIP_THIRD_PARTY=1)" + ) else: print("Cloning third-party repositories...") self._clone_and_checkout(