Skip to content

Commit 46095f0

Browse files
authored
[MUSA] Update 3rd party dir to build/_deps (#18035)
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
1 parent ef134d4 commit 46095f0

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,6 @@ python/sglang/srt/grpc/*_pb2.pyi
272272
sgl-kernel/csrc_musa/
273273
sgl-kernel/include_musa/
274274
sgl-kernel/csrc/**/*_musa/
275-
sgl-kernel/third_party/*/csrc_musa/
276-
sgl-kernel/third_party/*/include_musa/
277-
278-
# Third-party libraries source code
279-
sgl-kernel/third_party/
280275

281276
# MUSA core dump files
282277
*.mudmp

sgl-kernel/setup_musa.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
2929

3030
root = Path(__file__).parent.resolve()
31-
third_party = Path("third_party")
31+
third_party = Path(os.environ.get("SGLANG_MUSA_THIRD_PARTY_DIR", "build/_deps"))
3232
arch = platform.machine().lower()
3333

3434

@@ -160,7 +160,7 @@ class _CustomBuildExt(BuildExtension):
160160
@staticmethod
161161
def _clone_and_checkout(repo_path, repo_url, git_tag, git_shallow):
162162
"""Clone a git repository and checkout a specific tag/commit."""
163-
repo_path.parent.mkdir(exist_ok=True)
163+
repo_path.parent.mkdir(parents=True, exist_ok=True)
164164
if not repo_path.exists():
165165
clone_cmd = ["git", "clone"]
166166
if git_shallow:
@@ -173,8 +173,10 @@ def _clone_and_checkout(repo_path, repo_url, git_tag, git_shallow):
173173
subprocess.check_call(["git", "checkout", git_tag], cwd=repo_path)
174174

175175
def run(self):
176-
if os.environ.get("SKIP_THIRD_PARTY", "0") == "1":
177-
print("Skipping third-party repositories cloning (SKIP_THIRD_PARTY=1)")
176+
if os.environ.get("SGLANG_MUSA_SKIP_THIRD_PARTY", "0") == "1":
177+
print(
178+
"Skipping third-party repositories cloning (SGLANG_MUSA_SKIP_THIRD_PARTY=1)"
179+
)
178180
else:
179181
print("Cloning third-party repositories...")
180182
self._clone_and_checkout(

0 commit comments

Comments
 (0)