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
28bc60dc
Unverified
Commit
28bc60dc
authored
Dec 02, 2024
by
Yineng Zhang
Committed by
GitHub
Dec 02, 2024
Browse files
misc: update build setup (#2306)
parent
7301a39b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
1 deletion
+46
-1
.gitignore
.gitignore
+2
-0
sgl-kernel/Makefile
sgl-kernel/Makefile
+19
-0
sgl-kernel/build.sh
sgl-kernel/build.sh
+13
-0
sgl-kernel/setup.py
sgl-kernel/setup.py
+12
-0
sgl-kernel/src/sgl-kernel/csrc/warp_reduce.cc
sgl-kernel/src/sgl-kernel/csrc/warp_reduce.cc
+0
-1
No files found.
.gitignore
View file @
28bc60dc
...
@@ -218,3 +218,5 @@ work_dirs/
...
@@ -218,3 +218,5 @@ work_dirs/
*.exe
*.exe
*.out
*.out
*.app
*.app
compile_commands.json
sgl-kernel/Makefile
0 → 100644
View file @
28bc60dc
.PHONY
:
tree ln install build clean test
tree
:
@
tree
--prune
-I
"__pycache__|*.egg-info|*.so|build"
ln
:
@
rm
-rf
build
&&
cmake
.
-DCMAKE_EXPORT_COMPILE_COMMANDS
=
1
-DCMAKE_CUDA_COMPILER
=
nvcc
-B
build
&&
rm
-rf
compile_commands.json
&&
ln
-s
build/compile_commands.json compile_commands.json
install
:
@
pip
install
-e
.
build
:
@
python3 setup.py bdist_wheel
clean
:
@
rm
-rf
build dist
*
.egg-info
test
:
@
pytest tests/
sgl-kernel/build.sh
0 → 100755
View file @
28bc60dc
#!/bin/bash
set
-ex
docker run
--rm
-it
\
-v
"
$(
pwd
)
"
:/sgl-kernel
\
pytorch/manylinux-builder:cuda12.1
\
bash
-c
"
pip install --no-cache-dir torch==2.4.0 --index-url https://download.pytorch.org/whl/cu121 &&
\
export TORCH_CUDA_ARCH_LIST='7.5 8.0 8.9 9.0+PTX' &&
\
cd /sgl-kernel &&
\
python setup.py bdist_wheel
"
sgl-kernel/setup.py
View file @
28bc60dc
...
@@ -13,6 +13,18 @@ setup(
...
@@ -13,6 +13,18 @@ setup(
"src/sgl-kernel/csrc/warp_reduce.cc"
,
"src/sgl-kernel/csrc/warp_reduce.cc"
,
"src/sgl-kernel/csrc/warp_reduce_kernel.cu"
,
"src/sgl-kernel/csrc/warp_reduce_kernel.cu"
,
],
],
extra_compile_args
=
{
"nvcc"
:
[
"-O3"
,
"-Xcompiler"
,
"-fPIC"
,
"-gencode=arch=compute_75,code=sm_75"
,
"-gencode=arch=compute_80,code=sm_80"
,
"-gencode=arch=compute_89,code=sm_89"
,
"-gencode=arch=compute_90,code=sm_90"
,
],
"cxx"
:
[
"-O3"
],
},
)
)
],
],
cmdclass
=
{
"build_ext"
:
BuildExtension
},
cmdclass
=
{
"build_ext"
:
BuildExtension
},
...
...
sgl-kernel/src/sgl-kernel/csrc/warp_reduce.cc
View file @
28bc60dc
#include <torch/extension.h>
#include <torch/extension.h>
#include <vector>
torch
::
Tensor
warp_reduce_cuda
(
torch
::
Tensor
input
);
torch
::
Tensor
warp_reduce_cuda
(
torch
::
Tensor
input
);
...
...
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