[CI]Add performance CI for VLM (#6038)
Signed-off-by: Xinyuan Tong <justinning0323@outlook.com>
This commit is contained in:
@@ -7,6 +7,8 @@ from sglang.test.test_utils import (
|
||||
DEFAULT_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_MODEL_NAME_FOR_TEST_FP8,
|
||||
DEFAULT_MOE_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_SMALL_VLM_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_VLM_CHAT_TEMPLATE_FOR_TEST,
|
||||
CustomTestCase,
|
||||
is_in_ci,
|
||||
run_bench_serving,
|
||||
@@ -148,6 +150,58 @@ class TestBenchServing(CustomTestCase):
|
||||
self.assertLess(res["median_ttft_ms"], 86)
|
||||
self.assertLess(res["median_itl_ms"], 10)
|
||||
|
||||
def test_vlm_offline_throughput(self):
|
||||
res = run_bench_serving(
|
||||
model=DEFAULT_SMALL_VLM_MODEL_NAME_FOR_TEST,
|
||||
num_prompts=200,
|
||||
request_rate=float("inf"),
|
||||
other_server_args=[
|
||||
"--chat-template",
|
||||
DEFAULT_VLM_CHAT_TEMPLATE_FOR_TEST,
|
||||
"--mem-fraction-static",
|
||||
"0.7",
|
||||
],
|
||||
dataset_name="mmmu",
|
||||
)
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_vlm_offline_throughput\n"
|
||||
f'Output throughput: {res["output_throughput"]:.2f} token/s\n'
|
||||
)
|
||||
if os.getenv("SGLANG_AMD_CI") == "1":
|
||||
self.assertGreater(res["output_throughput"], 2000)
|
||||
# TODO: not set yet, need AMD machine
|
||||
else:
|
||||
self.assertGreater(res["output_throughput"], 2500)
|
||||
|
||||
def test_vlm_online_latency(self):
|
||||
res = run_bench_serving(
|
||||
model=DEFAULT_SMALL_VLM_MODEL_NAME_FOR_TEST,
|
||||
num_prompts=50,
|
||||
request_rate=1,
|
||||
other_server_args=[
|
||||
"--chat-template",
|
||||
DEFAULT_VLM_CHAT_TEMPLATE_FOR_TEST,
|
||||
"--mem-fraction-static",
|
||||
"0.7",
|
||||
],
|
||||
dataset_name="mmmu",
|
||||
)
|
||||
|
||||
if is_in_ci():
|
||||
write_github_step_summary(
|
||||
f"### test_vlm_online_latency\n"
|
||||
f'median_e2e_latency_ms: {res["median_e2e_latency_ms"]:.2f} ms\n'
|
||||
)
|
||||
self.assertLess(res["median_e2e_latency_ms"], 16000)
|
||||
if os.getenv("SGLANG_AMD_CI") == "1":
|
||||
self.assertLess(res["median_ttft_ms"], 150)
|
||||
# TODO: not set yet, need AMD machine
|
||||
else:
|
||||
self.assertLess(res["median_ttft_ms"], 90)
|
||||
self.assertLess(res["median_itl_ms"], 8)
|
||||
|
||||
def test_online_latency_eagle(self):
|
||||
res = run_bench_serving(
|
||||
model=DEFAULT_EAGLE_TARGET_MODEL_FOR_TEST,
|
||||
|
||||
@@ -16,7 +16,7 @@ from sglang.srt.utils import kill_process_tree
|
||||
from sglang.test.test_utils import (
|
||||
DEFAULT_IMAGE_URL,
|
||||
DEFAULT_SMALL_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_SMALL_VLM_MODEL_NAME,
|
||||
DEFAULT_SMALL_VLM_MODEL_NAME_FOR_TEST,
|
||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||
DEFAULT_URL_FOR_TEST,
|
||||
CustomTestCase,
|
||||
@@ -195,7 +195,7 @@ class TestSkipTokenizerInitVLM(TestSkipTokenizerInit):
|
||||
cls.image_url = DEFAULT_IMAGE_URL
|
||||
response = requests.get(cls.image_url)
|
||||
cls.image = Image.open(BytesIO(response.content))
|
||||
cls.model = DEFAULT_SMALL_VLM_MODEL_NAME
|
||||
cls.model = DEFAULT_SMALL_VLM_MODEL_NAME_FOR_TEST
|
||||
cls.tokenizer = AutoTokenizer.from_pretrained(cls.model, use_fast=False)
|
||||
cls.processor = AutoProcessor.from_pretrained(cls.model, trust_remote_code=True)
|
||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||
|
||||
Reference in New Issue
Block a user