From eeee3abbbf8196e54c227faecfd5faba7b1dfc4b Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Thu, 25 Jun 2026 22:19:30 -0700 Subject: [PATCH] [CI] Fix false spec accept length failure after profiling phase (#29329) Co-authored-by: Cursor --- python/sglang/test/performance_test_runner.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/sglang/test/performance_test_runner.py b/python/sglang/test/performance_test_runner.py index 398252148..ad4447ddf 100644 --- a/python/sglang/test/performance_test_runner.py +++ b/python/sglang/test/performance_test_runner.py @@ -86,6 +86,20 @@ def run_performance_test( perf_runner.add_report(results, variant=model.variant) print(f"✓ Performance test succeeded for {model.model_path}") + # The cumulative /server_info accept length is reset by the cache + # flush before the profiling phase, so it can be missing here. Fall + # back to the per-run accept lengths captured during benchmarking. + if avg_spec_accept_length is None: + run_accept_lengths = [ + r.acc_length + for r in results + if r.acc_length is not None and r.acc_length > 0 + ] + if run_accept_lengths: + avg_spec_accept_length = sum(run_accept_lengths) / len( + run_accept_lengths + ) + # Validate speculative decoding accept length if threshold is set error_msg = None passed = True