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
7d8c0ce7
Unverified
Commit
7d8c0ce7
authored
Apr 03, 2025
by
Yuhong Guo
Committed by
GitHub
Apr 03, 2025
Browse files
[Build] Support build sgl-kernel with ccache (#5020)
parent
e41549c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
docker/Dockerfile.dev
docker/Dockerfile.dev
+2
-0
sgl-kernel/CMakeLists.txt
sgl-kernel/CMakeLists.txt
+8
-0
sgl-kernel/README.md
sgl-kernel/README.md
+12
-0
No files found.
docker/Dockerfile.dev
View file @
7d8c0ce7
...
...
@@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
bear \
ccache \
&& apt install -y rdma-core infiniband-diags openssh-server perftest ibverbs-providers libibumad3 libibverbs1 libnl-3-200 libnl-route-3-200 librdmacm1 \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
...
...
@@ -44,6 +45,7 @@ RUN python3 -m pip install --no-cache-dir \
black \
isort \
icdiff \
uv \
pre-commit
# Install diff-so-fancy
...
...
sgl-kernel/CMakeLists.txt
View file @
7d8c0ce7
...
...
@@ -58,6 +58,14 @@ FetchContent_Declare(
)
FetchContent_Populate
(
repo-flash-attention
)
# ccache option
option
(
ENABLE_CCACHE
"Whether to use ccache"
ON
)
find_program
(
CCACHE_FOUND ccache
)
if
(
CCACHE_FOUND AND ENABLE_CCACHE AND DEFINED ENV{CCACHE_DIR}
)
message
(
STATUS
"Building with CCACHE enabled"
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_COMPILE
"ccache"
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_LINK
"ccache"
)
endif
()
include_directories
(
${
PROJECT_SOURCE_DIR
}
/include
...
...
sgl-kernel/README.md
View file @
7d8c0ce7
...
...
@@ -144,6 +144,18 @@ Note:
The
`sgl-kernel`
is rapidly evolving. If you experience a compilation failure, try using
`make rebuild`
.
#### Build with [ccache](https://github.com/ccache/ccache)
```
bash
# or `yum install -y ccache`.
apt-get
install
-y
ccache
# Building with ccache is enabled when ccache is installed and CCACHE_DIR is set.
export
CCACHE_DIR
=
/path/to/your/ccache/dir
export
CCACHE_BACKEND
=
""
export
CCACHE_KEEP_LOCAL_STORAGE
=
"TRUE"
unset
CCACHE_READONLY
python
-m
uv build
--wheel
-Cbuild-dir
=
build
--color
=
always .
```
### Testing & Benchmarking
1.
Add pytest tests in
[
tests/
](
https://github.com/sgl-project/sglang/tree/main/sgl-kernel/tests
)
...
...
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