Files
sglang/test/srt/test_chunked_prefill.py

52 lines
1.5 KiB
Python
Raw Normal View History

"""
python3 -m unittest test_chunked_prefill.TestChunkedPrefill.test_mixed_chunked_prefill_without_radix_cache
"""
2024-08-03 23:09:21 -07:00
import unittest
from sglang.test.test_utils import (
DEFAULT_MODEL_NAME_FOR_TEST,
2024-10-07 14:34:14 +08:00
run_bench_serving,
run_mmlu_test,
2024-10-30 21:20:41 -07:00
run_mulit_request_test,
)
2024-08-03 23:09:21 -07:00
2024-08-12 02:21:38 -07:00
class TestChunkedPrefill(unittest.TestCase):
def test_chunked_prefill(self):
run_mmlu_test(disable_radix_cache=False, enable_mixed_chunk=False)
2024-08-16 02:13:00 -07:00
def test_mixed_chunked_prefill(self):
run_mmlu_test(disable_radix_cache=False, enable_mixed_chunk=True)
2024-08-12 02:21:38 -07:00
def test_chunked_prefill_without_radix_cache(self):
run_mmlu_test(disable_radix_cache=True, enable_mixed_chunk=False)
2024-08-16 02:13:00 -07:00
def test_mixed_chunked_prefill_without_radix_cache(self):
run_mmlu_test(disable_radix_cache=True, enable_mixed_chunk=True)
2024-08-03 23:09:21 -07:00
def test_no_chunked_prefill(self):
run_mmlu_test(
disable_radix_cache=False, enable_mixed_chunk=False, chunked_prefill_size=-1
)
2024-10-07 14:34:14 +08:00
def test_no_chunked_prefill_without_radix_cache(self):
res = run_bench_serving(
model=DEFAULT_MODEL_NAME_FOR_TEST,
num_prompts=10,
request_rate=float("inf"),
other_server_args=["--disable-radix-cache", "--chunked-prefill-size", "-1"],
)
assert res["completed"] == 10
2024-10-30 21:20:41 -07:00
def test_mixed_chunked_prefill_multi_requests(self):
run_mulit_request_test(
enable_mixed_chunk=True,
chunked_prefill_size=2048,
)
2024-08-03 23:09:21 -07:00
if __name__ == "__main__":
2024-08-10 15:09:03 -07:00
unittest.main()