From 39752367f7afc171cf4fc84b8f816fef2fb6ad60 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Mon, 12 Aug 2024 09:24:20 +0000 Subject: [PATCH 1/2] Fix accuracy test --- python/sglang/test/simple_eval_humaneval.py | 10 ++-------- test/srt/test_eval_accuracy_large.py | 10 +++++----- test/srt/test_serving_throughput.py | 4 ++-- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/python/sglang/test/simple_eval_humaneval.py b/python/sglang/test/simple_eval_humaneval.py index 7a0f90c467389..efb0d0bd6f5af 100644 --- a/python/sglang/test/simple_eval_humaneval.py +++ b/python/sglang/test/simple_eval_humaneval.py @@ -6,21 +6,15 @@ https://arxiv.org/abs/2107.03374 https://github.com/openai/human-eval/ """ -import json -import logging -import multiprocessing import random import re -from collections import Counter, defaultdict from concurrent.futures import ThreadPoolExecutor, as_completed -from io import BytesIO -from typing import Any, Dict, List, Tuple +from typing import Dict, List -import blobfile as bf import tqdm try: - from human_eval.data import HUMAN_EVAL, read_problems + from human_eval.data import read_problems from human_eval.evaluation import estimate_pass_at_k from human_eval.execution import check_correctness # , unsafe_execute except (ImportError, ModuleNotFoundError): diff --git a/test/srt/test_eval_accuracy_large.py b/test/srt/test_eval_accuracy_large.py index 84a60dbe907a1..2cf564648e0ef 100644 --- a/test/srt/test_eval_accuracy_large.py +++ b/test/srt/test_eval_accuracy_large.py @@ -32,12 +32,12 @@ def test_mmlu(self): base_url=self.base_url, model=self.model, eval_name="mmlu", - num_examples=None, - num_threads=2048, + num_examples=3000, + num_threads=1024, ) metrics = run_eval(args) - assert metrics["score"] >= 0.70 + assert metrics["score"] >= 0.71 def test_human_eval(self): args = SimpleNamespace( @@ -45,7 +45,7 @@ def test_human_eval(self): model=self.model, eval_name="humaneval", num_examples=None, - num_threads=2048, + num_threads=1024, ) metrics = run_eval(args) @@ -57,7 +57,7 @@ def test_mgsm_en(self): model=self.model, eval_name="mgsm_en", num_examples=None, - num_threads=2048, + num_threads=1024, ) metrics = run_eval(args) diff --git a/test/srt/test_serving_throughput.py b/test/srt/test_serving_throughput.py index 25b07d8816d22..53ba034c95073 100644 --- a/test/srt/test_serving_throughput.py +++ b/test/srt/test_serving_throughput.py @@ -67,7 +67,7 @@ def test_default(self): if os.getenv("SGLANG_IS_IN_CI", "false") == "true": # A100 performance - assert res["output_throughput"] >= 1300 + assert res["output_throughput"] >= 1400 def test_default_without_radix_cache(self): res = self.run_test( @@ -78,7 +78,7 @@ def test_default_without_radix_cache(self): if os.getenv("SGLANG_IS_IN_CI", "false") == "true": # A100 performance - assert res["output_throughput"] >= 1400 + assert res["output_throughput"] >= 1450 def test_default_without_flashinfer(self): self.run_test( From bb2a0fc517768b18556d844ee31934aaba55f299 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Mon, 12 Aug 2024 09:36:46 +0000 Subject: [PATCH 2/2] update --- python/sglang/test/run_eval.py | 3 ++- test/srt/test_eval_accuracy_large.py | 6 +++--- test/srt/test_serving_throughput.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/python/sglang/test/run_eval.py b/python/sglang/test/run_eval.py index 3d13d475b0f0d..51b32ca01b3fd 100644 --- a/python/sglang/test/run_eval.py +++ b/python/sglang/test/run_eval.py @@ -16,6 +16,8 @@ def run_eval(args): + set_ulimit() + if "OPENAI_API_KEY" not in os.environ: os.environ["OPENAI_API_KEY"] = "EMPTY" @@ -117,7 +119,6 @@ def run_eval(args): parser.add_argument("--eval-name", type=str, default="mmlu") parser.add_argument("--num-examples", type=int) parser.add_argument("--num-threads", type=int, default=512) - set_ulimit() args = parser.parse_args() run_eval(args) diff --git a/test/srt/test_eval_accuracy_large.py b/test/srt/test_eval_accuracy_large.py index 2cf564648e0ef..556954331386c 100644 --- a/test/srt/test_eval_accuracy_large.py +++ b/test/srt/test_eval_accuracy_large.py @@ -37,7 +37,7 @@ def test_mmlu(self): ) metrics = run_eval(args) - assert metrics["score"] >= 0.71 + assert metrics["score"] >= 0.71, f"{metrics}" def test_human_eval(self): args = SimpleNamespace( @@ -49,7 +49,7 @@ def test_human_eval(self): ) metrics = run_eval(args) - assert metrics["score"] >= 0.65 + assert metrics["score"] >= 0.65, f"{metrics}" def test_mgsm_en(self): args = SimpleNamespace( @@ -61,7 +61,7 @@ def test_mgsm_en(self): ) metrics = run_eval(args) - assert metrics["score"] >= 0.85 + assert metrics["score"] >= 0.85, f"{metrics}" if __name__ == "__main__": diff --git a/test/srt/test_serving_throughput.py b/test/srt/test_serving_throughput.py index 53ba034c95073..0066d01cb2ce6 100644 --- a/test/srt/test_serving_throughput.py +++ b/test/srt/test_serving_throughput.py @@ -66,7 +66,7 @@ def test_default(self): ) if os.getenv("SGLANG_IS_IN_CI", "false") == "true": - # A100 performance + # A100 (PCIE) performance assert res["output_throughput"] >= 1400 def test_default_without_radix_cache(self): @@ -77,7 +77,7 @@ def test_default_without_radix_cache(self): ) if os.getenv("SGLANG_IS_IN_CI", "false") == "true": - # A100 performance + # A100 (PCIE) performance assert res["output_throughput"] >= 1450 def test_default_without_flashinfer(self):