Skip to content

Commit f5f5e89

Browse files
authored
Merge pull request #4 from DeepAuto-AI/deepauto/feat/update_main
Merge upstream commits
2 parents 0005b7e + 1849c48 commit f5f5e89

File tree

225 files changed

+12878
-3685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+12878
-3685
lines changed

.devcontainer/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From lmsysorg/sglang:dev
2+
3+
# Create non-root user with specified UID and GID
4+
# NOTE: Replace with your own UID and GID. This is a workaround from https://github.com/microsoft/vscode-remote-release/issues/49#issuecomment-489060908.
5+
ARG HOST_UID=1003
6+
ARG HOST_GID=1003
7+
RUN groupadd -g $HOST_GID devuser && \
8+
useradd -m -u $HOST_UID -g $HOST_GID -s /bin/zsh devuser
9+
10+
# Give devuser sudo access
11+
RUN apt-get update && apt-get install -y sudo && \
12+
echo "devuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/devuser && \
13+
rm -rf /var/lib/apt/lists/* && \
14+
apt-get clean
15+
16+
# Set up oh-my-zsh for devuser
17+
RUN cp -r /root/.oh-my-zsh /home/devuser/.oh-my-zsh && \
18+
cp /root/.zshrc /home/devuser/.zshrc && \
19+
cp /root/.vimrc /home/devuser/.vimrc && \
20+
cp /root/.tmux.conf /home/devuser/.tmux.conf && \
21+
sed -i 's|/root/.oh-my-zsh|/home/devuser/.oh-my-zsh|g' /home/devuser/.zshrc && \
22+
chown -R devuser:devuser /home/devuser/
23+
24+
# Set workspace directory and ownership
25+
WORKDIR /sgl-workspace/sglang
26+
RUN chown -R devuser:devuser /sgl-workspace
27+
28+
# Switch to devuser
29+
USER devuser
30+
31+
# Install uv
32+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
33+
34+
# Install rust
35+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

.devcontainer/devcontainer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "sglang",
33
"build": {
4-
"dockerfile": "../docker/Dockerfile.dev"
4+
"dockerfile": "Dockerfile"
55
},
6+
"remoteUser": "devuser",
67
"customizations": {
78
"vscode": {
89
"extensions": [
@@ -15,6 +16,9 @@
1516
]
1617
}
1718
},
18-
"workspaceFolder": "/sgl-workspace/sglang",
19-
"forwardPorts": []
19+
"forwardPorts": [],
20+
"runArgs": [
21+
"--gpus",
22+
"all"
23+
]
2024
}

.github/workflows/execute-notebook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
python -m ipykernel install --user --name python3 --display-name "Python 3"
4343
4444
- name: Execute notebooks
45-
timeout-minutes: 30
45+
timeout-minutes: 40
4646
run: |
4747
cd docs
4848
make clean

.github/workflows/pr-test-rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
cd sgl-router/
4141
cargo test
4242
43-
e2e-rust:
43+
e2e-python:
4444
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
4545
runs-on: 2-gpu-runner
4646
steps:
@@ -65,7 +65,7 @@ jobs:
6565
python3 run_suite.py
6666
6767
finish:
68-
needs: [unit-test-rust, e2e-rust]
68+
needs: [unit-test-rust, e2e-python]
6969
runs-on: ubuntu-latest
7070
steps:
7171
- name: Finish

.github/workflows/pr-test-sgl-kernel.yml

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,77 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19-
unit-test:
20-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
21-
runs-on: 1-gpu-runner
19+
lint:
20+
runs-on: ubuntu-latest
2221
steps:
2322
- name: Checkout code
2423
uses: actions/checkout@v3
2524

26-
- name: Install dependencies
25+
- name: Check clang-format
26+
uses: DoozyX/[email protected]
27+
with:
28+
source: sgl-kernel
29+
extensions: h,c,cpp,hpp,cu,cuh,cc
30+
clangFormatVersion: 16
31+
style: file
32+
33+
build-wheels:
34+
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
35+
runs-on: sgl-kernel-build-node
36+
strategy:
37+
matrix:
38+
python-version: ['3.9']
39+
cuda-version: ['12.4']
40+
41+
steps:
42+
- name: Cleanup
2743
run: |
28-
bash scripts/ci_install_dependency.sh
44+
sudo rm -rf $GITHUB_WORKSPACE/* || true
45+
46+
- uses: actions/checkout@v4
47+
with:
48+
submodules: 'recursive'
49+
50+
- name: Set up Python ${{ matrix.python-version }}
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: ${{ matrix.python-version }}
2954

55+
- name: Build wheels for Python ${{ matrix.python-version }} and CUDA ${{ matrix.cuda-version }}
56+
run: |
3057
cd sgl-kernel
31-
git submodule update --init --recursive
32-
pip3 install -e . --force-reinstall
58+
chmod +x ./build.sh
59+
./build.sh "${{ matrix.python-version }}" "${{ matrix.cuda-version }}"
60+
61+
- name: Upload artifacts
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: wheel-python${{ matrix.python-version }}-cuda${{ matrix.cuda-version }}
65+
path: sgl-kernel/dist/*
66+
67+
unit-test:
68+
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
69+
needs: build-wheels
70+
runs-on: 1-gpu-runner
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Download artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
path: sgl-kernel/dist/
78+
merge-multiple: true
79+
pattern: wheel-*
80+
81+
- name: Install
82+
run: |
83+
pip3 install torch==2.5.1 && pip3 install pytest && pip3 install vllm==0.6.4.post1
84+
pip3 uninstall sgl-kernel -y || true
85+
pip3 install sgl-kernel/dist/*whl --force-reinstall --no-deps
3386
pip3 list | grep sgl-kernel
3487
3588
- name: Run test
36-
timeout-minutes: 10
89+
timeout-minutes: 30
3790
run: |
3891
cd sgl-kernel
3992
find tests -name "test_*.py" | xargs -n 1 python3
@@ -43,7 +96,7 @@ jobs:
4396
pip3 uninstall sgl-kernel -y
4497
4598
finish:
46-
needs: [unit-test]
99+
needs: [unit-test, lint]
47100
runs-on: ubuntu-latest
48101
steps:
49102
- name: Finish

.github/workflows/pr-test.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ concurrency:
2929
jobs:
3030

3131
unit-test-frontend:
32-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
32+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
3333
runs-on: 1-gpu-runner
3434
steps:
3535
- name: Checkout code
@@ -48,11 +48,12 @@ jobs:
4848
python3 run_suite.py --suite per-commit
4949
5050
unit-test-backend-1-gpu:
51-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
51+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
5252
runs-on: 1-gpu-runner
5353
strategy:
54+
fail-fast: false
5455
matrix:
55-
range: [0-6, 6-16, 16-23, 23-30, 30-38, 38-100]
56+
range: [0-6, 6-15, 15-22, 22-32, 32-40, 40-100]
5657
steps:
5758
- name: Checkout code
5859
uses: actions/checkout@v3
@@ -75,7 +76,7 @@ jobs:
7576
7677
7778
unit-test-backend-2-gpu:
78-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
79+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
7980
runs-on: 2-gpu-runner
8081
steps:
8182
- name: Checkout code
@@ -112,7 +113,7 @@ jobs:
112113
python3 test_moe_ep.py
113114
114115
performance-test-1-gpu-part-1:
115-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
116+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
116117
runs-on: 1-gpu-runner
117118
steps:
118119
- name: Checkout code
@@ -128,7 +129,7 @@ jobs:
128129
timeout-minutes: 10
129130
run: |
130131
cd test/srt
131-
python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_default
132+
python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_bs1
132133
133134
- name: Benchmark online latency
134135
timeout-minutes: 10
@@ -148,8 +149,15 @@ jobs:
148149
cd test/srt
149150
python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_non_stream_small_batch_size
150151
152+
- name: Benchmark online latency (EAGLE)
153+
timeout-minutes: 10
154+
run: |
155+
cd test/srt
156+
python3 -m unittest test_bench_serving.TestBenchServing.test_online_latency_eagle
157+
158+
151159
performance-test-1-gpu-part-2:
152-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
160+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
153161
runs-on: 1-gpu-runner
154162
steps:
155163
- name: Checkout code
@@ -180,7 +188,7 @@ jobs:
180188
python3 -m unittest test_bench_serving.TestBenchServing.test_offline_throughput_default_fp8
181189
182190
performance-test-2-gpu:
183-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
191+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
184192
runs-on: 2-gpu-runner
185193
steps:
186194
- name: Checkout code
@@ -196,7 +204,13 @@ jobs:
196204
timeout-minutes: 10
197205
run: |
198206
cd test/srt
199-
python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_moe_default
207+
python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_moe_tp2_bs1
208+
209+
- name: Benchmark single latency + torch.compile (TP=2)
210+
timeout-minutes: 10
211+
run: |
212+
cd test/srt
213+
python3 -m unittest test_bench_one_batch.TestBenchOneBatch.test_torch_compile_tp2_bs1
200214
201215
- name: Benchmark offline throughput (TP=2)
202216
timeout-minutes: 10
@@ -210,8 +224,9 @@ jobs:
210224
cd test/srt
211225
python3 -m unittest test_bench_serving.TestBenchServing.test_moe_offline_throughput_without_radix_cache
212226
227+
213228
accuracy-test-1-gpu:
214-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
229+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
215230
runs-on: 1-gpu-runner
216231
steps:
217232
- name: Checkout code
@@ -235,7 +250,7 @@ jobs:
235250
236251
237252
accuracy-test-2-gpu:
238-
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
253+
if: (github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request') && github.event.pull_request.draft == false
239254
runs-on: 2-gpu-runner
240255
steps:
241256
- name: Checkout code

.github/workflows/release-pypi-kernel.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- sgl-kernel/pyproject.toml
8+
- sgl-kernel/version.py
99
workflow_dispatch:
1010

1111
concurrency:
@@ -14,11 +14,12 @@ concurrency:
1414

1515
jobs:
1616
build-wheels:
17+
if: github.repository == 'sgl-project/sglang'
1718
runs-on: ubuntu-latest
1819
strategy:
1920
matrix:
20-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
21-
cuda-version: ['12.1']
21+
python-version: ['3.9']
22+
cuda-version: ['12.4']
2223

2324
steps:
2425
- uses: actions/checkout@v4

.github/workflows/release-pypi-router.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches:
88
- main
99
paths:
10-
- sglang-router/pyproject.toml
10+
- sgl-router/pyproject.toml
1111
workflow_dispatch:
1212

1313
jobs:
@@ -26,9 +26,9 @@ jobs:
2626
with:
2727
path: sglang-repo
2828

29-
- name: Move sglang-router folder to root and delete sglang-repo
29+
- name: Move sgl-router folder to root and delete sglang-repo
3030
run: |
31-
mv sglang-repo/sglang-router/* .
31+
mv sglang-repo/sgl-router/* .
3232
rm -rf sglang-repo
3333
ls -alt
3434
@@ -69,9 +69,9 @@ jobs:
6969
with:
7070
path: sglang-repo
7171

72-
- name: Move sglang-router folder to root, copy the license file, and delete sglang-repo
72+
- name: Move sgl-router folder to root, copy the license file, and delete sglang-repo
7373
run: |
74-
mv sglang-repo/sglang-router/* .
74+
mv sglang-repo/sgl-router/* .
7575
mv sglang-repo/LICENSE .
7676
rm -rf sglang-repo
7777
ls -alt
@@ -84,6 +84,7 @@ jobs:
8484
- name: Build SDist
8585
run: |
8686
pip install build
87+
python -m pip install -U packaging
8788
python -m build --sdist
8889
8990
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)