Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
a222945d
Unverified
Commit
a222945d
authored
Apr 10, 2025
by
Elfie Guo
Committed by
GitHub
Apr 10, 2025
Browse files
Update Makefile / build script to avoid installing incompatible torch dependency (#5245)
parent
ed01b451
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
sgl-kernel/Makefile
sgl-kernel/Makefile
+4
-4
sgl-kernel/build.sh
sgl-kernel/build.sh
+16
-2
No files found.
sgl-kernel/Makefile
View file @
a222945d
...
@@ -10,7 +10,7 @@ check-deps: ## Check and install required Python formatting dependencies
...
@@ -10,7 +10,7 @@ check-deps: ## Check and install required Python formatting dependencies
@
command
-v
black
>
/dev/null 2>&1
||
(
echo
"Installing black..."
&&
pip
install
black
)
@
command
-v
black
>
/dev/null 2>&1
||
(
echo
"Installing black..."
&&
pip
install
black
)
install-deps
:
##
Install Python formatting tools (isort and black)
install-deps
:
##
Install Python formatting tools (isort and black)
pip
install
isort black
pip
install
scikit-build-core
isort black
tree
:
##
Show project directory structure
tree
:
##
Show project directory structure
@
tree
--prune
-I
"__pycache__|*.egg-info|*.so|build|3rdparty|dist"
@
tree
--prune
-I
"__pycache__|*.egg-info|*.so|build|3rdparty|dist"
...
@@ -23,10 +23,10 @@ ln: submodule ## Create compilation database
...
@@ -23,10 +23,10 @@ ln: submodule ## Create compilation database
install
:
submodule
##
Install package in development mode
install
:
submodule
##
Install package in development mode
@
pip
install
-e
.
@
pip
install
-e
.
--no-build-isolation
build
:
submodule
##
Build and install wheel package
build
:
install-deps
submodule
##
Build and install wheel package
@
rm
-rf
dist/
*
||
true
&&
export
MAX_JOBS
=
$(nproc)
&&
uv build
--wheel
-Cbuild-dir
=
build
.
--verbose
--color
=
always
&&
pip3
install
dist/
*
whl
--force-reinstall
--no-deps
@
rm
-rf
dist/
*
||
true
&&
export
MAX_JOBS
=
$(nproc)
&&
uv build
--wheel
-Cbuild-dir
=
build
.
--verbose
--color
=
always
--no-build-isolation
&&
pip3
install
dist/
*
whl
--force-reinstall
--no-deps
clean
:
##
Remove build artifacts
clean
:
##
Remove build artifacts
@
rm
-rf
build dist
*
.egg-info
@
rm
-rf
build dist
*
.egg-info
...
...
sgl-kernel/build.sh
View file @
a222945d
...
@@ -18,14 +18,28 @@ docker run --rm \
...
@@ -18,14 +18,28 @@ docker run --rm \
-v
$(
pwd
)
:/sgl-kernel
\
-v
$(
pwd
)
:/sgl-kernel
\
${
DOCKER_IMAGE
}
\
${
DOCKER_IMAGE
}
\
bash
-c
"
bash
-c
"
# Install CMake (version >= 3.26) - Robust Installation
export CMAKE_VERSION_MAJOR=3.31
export CMAKE_VERSION_MINOR=1
echo
\"
Downloading CMake from: https://cmake.org/files/v
\$
{CMAKE_VERSION_MAJOR}/cmake-
\$
{CMAKE_VERSION_MAJOR}.
\$
{CMAKE_VERSION_MINOR}-linux-x86_64.tar.gz
\"
wget https://cmake.org/files/v
\$
{CMAKE_VERSION_MAJOR}/cmake-
\$
{CMAKE_VERSION_MAJOR}.
\$
{CMAKE_VERSION_MINOR}-linux-x86_64.tar.gz
tar -xzf cmake-
\$
{CMAKE_VERSION_MAJOR}.
\$
{CMAKE_VERSION_MINOR}-linux-x86_64.tar.gz
mv cmake-
\$
{CMAKE_VERSION_MAJOR}.
\$
{CMAKE_VERSION_MINOR}-linux-x86_64 /opt/cmake
export PATH=/opt/cmake/bin:
\$
PATH
# Debugging CMake
echo
\"
PATH:
\$
PATH
\"
which cmake
cmake --version
${
PYTHON_ROOT_PATH
}
/bin/
${
TORCH_INSTALL
}
&&
\
${
PYTHON_ROOT_PATH
}
/bin/
${
TORCH_INSTALL
}
&&
\
${
PYTHON_ROOT_PATH
}
/bin/pip install --no-cache-dir ninja setuptools==75.0.0 wheel==0.41.0 numpy uv &&
\
${
PYTHON_ROOT_PATH
}
/bin/pip install --no-cache-dir ninja setuptools==75.0.0 wheel==0.41.0 numpy uv
scikit-build-core
&&
\
export TORCH_CUDA_ARCH_LIST='7.5 8.0 8.9 9.0+PTX' &&
\
export TORCH_CUDA_ARCH_LIST='7.5 8.0 8.9 9.0+PTX' &&
\
export CUDA_VERSION=
${
CUDA_VERSION
}
&&
\
export CUDA_VERSION=
${
CUDA_VERSION
}
&&
\
mkdir -p /usr/lib/x86_64-linux-gnu/ &&
\
mkdir -p /usr/lib/x86_64-linux-gnu/ &&
\
ln -s /usr/local/cuda-
${
CUDA_VERSION
}
/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so &&
\
ln -s /usr/local/cuda-
${
CUDA_VERSION
}
/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so &&
\
cd /sgl-kernel &&
\
cd /sgl-kernel &&
\
ls -la
${
PYTHON_ROOT_PATH
}
/lib/python
${
PYTHON_VERSION
}
/site-packages/wheel/ &&
\
ls -la
${
PYTHON_ROOT_PATH
}
/lib/python
${
PYTHON_VERSION
}
/site-packages/wheel/ &&
\
PYTHONPATH=
${
PYTHON_ROOT_PATH
}
/lib/python
${
PYTHON_VERSION
}
/site-packages
${
PYTHON_ROOT_PATH
}
/bin/python -m uv build --wheel -Cbuild-dir=build . --color=always &&
\
PYTHONPATH=
${
PYTHON_ROOT_PATH
}
/lib/python
${
PYTHON_VERSION
}
/site-packages
${
PYTHON_ROOT_PATH
}
/bin/python -m uv build --wheel -Cbuild-dir=build . --color=always
--no-build-isolation
&&
\
./rename_wheels.sh
./rename_wheels.sh
"
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment