Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch SGL Benchmark Test for Pytest Dashboard #551

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app_tests/benchmark_tests/llm/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def pre_process_model(request, tmp_path_factory):
settings = request.param["settings"]
batch_sizes = request.param["batch_sizes"]

tmp_dir = tmp_path_factory.mktemp("llm_benchmark_test")
mlir_path = tmp_dir / "model.mlir"
config_path = tmp_dir / "config.json"
vmfb_path = tmp_dir / "model.vmfb"
Expand Down
16 changes: 15 additions & 1 deletion app_tests/benchmark_tests/llm/sglang_benchmark_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@
TOKENIZER_DIR = Path("/data/llama3.1/8b/")


@pytest.mark.parametrize("request_rate", [1, 2, 4, 8, 16, 32])
def log_jsonl_result(file_path):
with open(file_path, "r") as file:
json_string = file.readline().strip()

json_data = json.loads(json_string)
for key, val in json_data.items():
logger.info(f"{key.upper()}: {val}")


@pytest.mark.parametrize(
"request_rate",
[1, 2, 4, 8, 16, 32],
)
@pytest.mark.parametrize(
"pre_process_model",
[
Expand Down Expand Up @@ -101,6 +113,8 @@ def test_sglang_benchmark_server(request_rate, pre_process_model):
benchmark_process.join()

logger.info(f"Benchmark run completed in {str(time.time() - start)} seconds")
logger.info("======== RESULTS ========")
log_jsonl_result(benchmark_args.output_file)
except Exception as e:
logger.info(e)

Expand Down
1 change: 1 addition & 0 deletions app_tests/benchmark_tests/llm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def as_namespace(self) -> Namespace:
dataset_name="sharegpt",
random_input_len=None,
random_output_len=None,
random_range_ratio=0.0,
dataset_path="",
sharegpt_output_len=None,
multi=False,
Expand Down
Loading