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
97589a60
Unverified
Commit
97589a60
authored
Aug 25, 2024
by
Mingyi
Committed by
GitHub
Aug 26, 2024
Browse files
[CI] Parallelize unit tests in CI (#1219)
parent
632d506d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
79 deletions
+103
-79
.github/workflows/accuracy-test.yml
.github/workflows/accuracy-test.yml
+15
-15
.github/workflows/e2e-test.yml
.github/workflows/e2e-test.yml
+26
-26
.github/workflows/moe-test.yml
.github/workflows/moe-test.yml
+17
-17
.github/workflows/unit-test.yml
.github/workflows/unit-test.yml
+30
-19
python/sglang/test/test_utils.py
python/sglang/test/test_utils.py
+1
-1
test/srt/run_suite.py
test/srt/run_suite.py
+14
-1
No files found.
.github/workflows/accuracy-test.yml
View file @
97589a60
...
@@ -23,21 +23,21 @@ jobs:
...
@@ -23,21 +23,21 @@ jobs:
runs-on
:
1-gpu-runner
runs-on
:
1-gpu-runner
steps
:
steps
:
-
name
:
Checkout code
-
name
:
Checkout code
uses
:
actions/checkout@v3
uses
:
actions/checkout@v3
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
pip install --upgrade pip
pip install --upgrade pip
pip install -e "python[all]"
pip install -e "python[all]"
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
git clone https://github.com/merrymercy/human-eval.git
git clone https://github.com/merrymercy/human-eval.git
cd human-eval
cd human-eval
pip install -e .
pip install -e .
-
name
:
Evaluate Accuracy
-
name
:
Evaluate Accuracy
timeout-minutes
:
20
timeout-minutes
:
20
run
:
|
run
:
|
cd test/srt
cd test/srt
python3 test_eval_accuracy_large.py
python3 test_eval_accuracy_large.py
.github/workflows/e2e-test.yml
View file @
97589a60
...
@@ -23,29 +23,29 @@ jobs:
...
@@ -23,29 +23,29 @@ jobs:
runs-on
:
1-gpu-runner
runs-on
:
1-gpu-runner
steps
:
steps
:
-
name
:
Checkout code
-
name
:
Checkout code
uses
:
actions/checkout@v3
uses
:
actions/checkout@v3
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
pip install --upgrade pip
pip install --upgrade pip
pip install -e "python[all]"
pip install -e "python[all]"
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
-
name
:
Benchmark Serving Throughput
-
name
:
Benchmark Serving Throughput
timeout-minutes
:
10
timeout-minutes
:
10
run
:
|
run
:
|
cd test/srt
cd test/srt
python3 -m unittest test_serving_throughput.TestServingThroughput.test_default
python3 -m unittest test_serving_throughput.TestServingThroughput.test_default
-
name
:
Benchmark Serving Throughput (w/o RadixAttention)
-
name
:
Benchmark Serving Throughput (w/o RadixAttention)
timeout-minutes
:
10
timeout-minutes
:
10
run
:
|
run
:
|
cd test/srt
cd test/srt
python3 -m unittest test_serving_throughput.TestServingThroughput.test_default_without_radix_cache
python3 -m unittest test_serving_throughput.TestServingThroughput.test_default_without_radix_cache
-
name
:
Benchmark Serving Throughput (w/o ChunkedPrefill)
-
name
:
Benchmark Serving Throughput (w/o ChunkedPrefill)
timeout-minutes
:
10
timeout-minutes
:
10
run
:
|
run
:
|
cd test/srt
cd test/srt
python3 -m unittest test_serving_throughput.TestServingThroughput.test_default_without_chunked_prefill
python3 -m unittest test_serving_throughput.TestServingThroughput.test_default_without_chunked_prefill
.github/workflows/moe-test.yml
View file @
97589a60
...
@@ -23,23 +23,23 @@ jobs:
...
@@ -23,23 +23,23 @@ jobs:
runs-on
:
2-gpu-runner
runs-on
:
2-gpu-runner
steps
:
steps
:
-
name
:
Checkout code
-
name
:
Checkout code
uses
:
actions/checkout@v3
uses
:
actions/checkout@v3
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
pip install --upgrade pip
pip install --upgrade pip
pip install -e "python[all]"
pip install -e "python[all]"
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
-
name
:
Benchmark MoE Serving Throughput
-
name
:
Benchmark MoE Serving Throughput
timeout-minutes
:
10
timeout-minutes
:
10
run
:
|
run
:
|
cd test/srt
cd test/srt
python3 -m unittest test_moe_serving_throughput.TestServingThroughput.test_default
python3 -m unittest test_moe_serving_throughput.TestServingThroughput.test_default
-
name
:
Benchmark MoE Serving Throughput (w/o RadixAttention)
-
name
:
Benchmark MoE Serving Throughput (w/o RadixAttention)
timeout-minutes
:
10
timeout-minutes
:
10
run
:
|
run
:
|
cd test/srt
cd test/srt
python3 -m unittest test_moe_serving_throughput.TestServingThroughput.test_default_without_radix_cache
python3 -m unittest test_moe_serving_throughput.TestServingThroughput.test_default_without_radix_cache
.github/workflows/unit-test.yml
View file @
97589a60
...
@@ -18,28 +18,39 @@ concurrency:
...
@@ -18,28 +18,39 @@ concurrency:
cancel-in-progress
:
true
cancel-in-progress
:
true
jobs
:
jobs
:
unit-test
:
unit-test
-jobs
:
if
:
github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
if
:
github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
runs-on
:
1-gpu-runner
runs-on
:
1-gpu-runner
strategy
:
matrix
:
test_type
:
[
'
backend-0'
,
'
backend-1'
,
'
frontend'
]
steps
:
steps
:
-
name
:
Checkout code
-
name
:
Checkout code
uses
:
actions/checkout@v3
uses
:
actions/checkout@v3
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
pip install --upgrade pip
pip install --upgrade pip
pip install -e "python[dev]"
pip install -e "python[dev]"
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ --force-reinstall
-
name
:
Test Backend Runtime
-
name
:
Run test
timeout-minutes
:
20
timeout-minutes
:
20
run
:
|
run
:
|
cd test/srt
if [ "${{ matrix.test_type }}" = "frontend" ]; then
python3 run_suite.py --suite minimal
cd test/lang
python3 run_suite.py --suite minimal
elif [ "${{ matrix.test_type }}" = "backend-0" ]; then
cd test/srt
python3 run_suite.py --suite minimal --range-begin 0 --range-end 8
elif [ "${{ matrix.test_type }}" = "backend-1" ]; then
cd test/srt
python3 run_suite.py --suite minimal --range-begin 8
fi
-
name
:
Test Frontend Language
unit-test
:
timeout-minutes
:
10
needs
:
unit-test-jobs
run
:
|
runs-on
:
ubuntu-latest
cd test/lang
steps
:
python3 run_suite.py --suite minimal
-
name
:
Merge step
run
:
echo "This is an empty merge step"
\ No newline at end of file
python/sglang/test/test_utils.py
View file @
97589a60
...
@@ -465,7 +465,7 @@ def run_unittest_files(files: List[str], timeout_per_file: float):
...
@@ -465,7 +465,7 @@ def run_unittest_files(files: List[str], timeout_per_file: float):
def
run_one_file
(
filename
):
def
run_one_file
(
filename
):
filename
=
os
.
path
.
join
(
os
.
getcwd
(),
filename
)
filename
=
os
.
path
.
join
(
os
.
getcwd
(),
filename
)
print
(
f
"
\n\n
Run
{
filename
}
\n\n
"
,
flush
=
True
)
print
(
f
"
\n\n
Run
:
\n
python3
{
filename
}
\n\n
"
,
flush
=
True
)
process
=
subprocess
.
Popen
(
process
=
subprocess
.
Popen
(
[
"python3"
,
filename
],
stdout
=
None
,
stderr
=
None
,
env
=
os
.
environ
[
"python3"
,
filename
],
stdout
=
None
,
stderr
=
None
,
env
=
os
.
environ
)
)
...
...
test/srt/run_suite.py
View file @
97589a60
import
argparse
import
argparse
import
glob
import
glob
import
multiprocessing
as
mp
from
sglang.test.test_utils
import
run_unittest_files
from
sglang.test.test_utils
import
run_unittest_files
...
@@ -49,6 +48,18 @@ if __name__ == "__main__":
...
@@ -49,6 +48,18 @@ if __name__ == "__main__":
choices
=
list
(
suites
.
keys
())
+
[
"all"
],
choices
=
list
(
suites
.
keys
())
+
[
"all"
],
help
=
"The suite to run"
,
help
=
"The suite to run"
,
)
)
arg_parser
.
add_argument
(
"--range-begin"
,
type
=
int
,
default
=
0
,
help
=
"The begin index of the range of the files to run."
,
)
arg_parser
.
add_argument
(
"--range-end"
,
type
=
int
,
default
=
None
,
help
=
"The end index of the range of the files to run."
,
)
args
=
arg_parser
.
parse_args
()
args
=
arg_parser
.
parse_args
()
if
args
.
suite
==
"all"
:
if
args
.
suite
==
"all"
:
...
@@ -56,5 +67,7 @@ if __name__ == "__main__":
...
@@ -56,5 +67,7 @@ if __name__ == "__main__":
else
:
else
:
files
=
suites
[
args
.
suite
]
files
=
suites
[
args
.
suite
]
files
=
files
[
args
.
range_begin
:
args
.
range_end
]
exit_code
=
run_unittest_files
(
files
,
args
.
timeout_per_file
)
exit_code
=
run_unittest_files
(
files
,
args
.
timeout_per_file
)
exit
(
exit_code
)
exit
(
exit_code
)
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