[MUSA] Update 3rd party dir to build/_deps (#18035)
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This commit is contained in:
@@ -272,11 +272,6 @@ python/sglang/srt/grpc/*_pb2.pyi
|
|||||||
sgl-kernel/csrc_musa/
|
sgl-kernel/csrc_musa/
|
||||||
sgl-kernel/include_musa/
|
sgl-kernel/include_musa/
|
||||||
sgl-kernel/csrc/**/*_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
|
# MUSA core dump files
|
||||||
*.mudmp
|
*.mudmp
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from setuptools import find_packages, setup
|
|||||||
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
|
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
|
||||||
|
|
||||||
root = Path(__file__).parent.resolve()
|
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()
|
arch = platform.machine().lower()
|
||||||
|
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ class _CustomBuildExt(BuildExtension):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _clone_and_checkout(repo_path, repo_url, git_tag, git_shallow):
|
def _clone_and_checkout(repo_path, repo_url, git_tag, git_shallow):
|
||||||
"""Clone a git repository and checkout a specific tag/commit."""
|
"""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():
|
if not repo_path.exists():
|
||||||
clone_cmd = ["git", "clone"]
|
clone_cmd = ["git", "clone"]
|
||||||
if git_shallow:
|
if git_shallow:
|
||||||
@@ -173,8 +173,10 @@ class _CustomBuildExt(BuildExtension):
|
|||||||
subprocess.check_call(["git", "checkout", git_tag], cwd=repo_path)
|
subprocess.check_call(["git", "checkout", git_tag], cwd=repo_path)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if os.environ.get("SKIP_THIRD_PARTY", "0") == "1":
|
if os.environ.get("SGLANG_MUSA_SKIP_THIRD_PARTY", "0") == "1":
|
||||||
print("Skipping third-party repositories cloning (SKIP_THIRD_PARTY=1)")
|
print(
|
||||||
|
"Skipping third-party repositories cloning (SGLANG_MUSA_SKIP_THIRD_PARTY=1)"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
print("Cloning third-party repositories...")
|
print("Cloning third-party repositories...")
|
||||||
self._clone_and_checkout(
|
self._clone_and_checkout(
|
||||||
|
|||||||
Reference in New Issue
Block a user