ci: refactor nightly test (#10495)

This commit is contained in:
Mick
2025-09-27 06:24:30 +08:00
committed by GitHub
parent 05a3526654
commit 777eb53897
16 changed files with 1656 additions and 187 deletions

View File

@@ -14,6 +14,7 @@ from sglang.test.test_utils import (
is_in_ci,
popen_launch_server,
write_github_step_summary,
write_results_to_json,
)
MODEL_SCORE_THRESHOLDS = {
@@ -52,31 +53,6 @@ def popen_launch_server_wrapper(base_url, model, is_fp8, is_tp2):
return process
def write_results_to_json(model, metrics, mode="a"):
result = {
"timestamp": datetime.now().isoformat(),
"model": model,
"metrics": metrics,
"score": metrics["score"],
}
existing_results = []
if mode == "a" and os.path.exists("results.json"):
try:
with open("results.json", "r") as f:
existing_results = json.load(f)
except json.JSONDecodeError:
existing_results = []
if isinstance(existing_results, list):
existing_results.append(result)
else:
existing_results = [result]
with open("results.json", "w") as f:
json.dump(existing_results, f, indent=2)
def check_model_scores(results):
failed_models = []
summary = " | model | score | threshold |\n"