Repository navigation
fix(benchmark): scrape every SGLang attention-DP process for custom AIPerf metrics - #554
Open
weireweire wants to merge 1 commit into
Open
weireweire wants to merge 1 commit into
weireweire wants to merge 1 commit into
Conversation
…IPerf metrics Root cause: custom benchmarks advertise only logical worker leaders in AIPERF_SERVER_METRICS_URLS, on the assumption that a multi-node worker's follower ranks duplicate the leader's engine. That holds for pure TP, but with attention data parallelism (dp-size > 1) each physical SGLang process schedules its own attention-DP ranks and exports distinct cache and load metrics for them. Scraping only the leader drops every follower node's ranks, so server-side cache-hit and load metrics cover only part of the deployment (for example prefill DP0-3 of DP0-7, and 4 of 16 decode ranks on a 2-node prefill / 4-node decode layout). Fix: when the backend is SGLang, the worker is not a sidecar, and any role sets dp-size > 1, custom benchmarks receive the physical-process metrics list (the one built-in AIPerf runners already use). If no physical metrics ports can be enumerated (a single-node DEP worker), they keep the logical leader URLs. Routing endpoints (SRT_*_ENDPOINTS) are unchanged and still logical. An explicit AIPERF_SERVER_METRICS_URLS in the recipe still wins. Validation: new unit tests cover attention-DP disaggregation (leader and follower URLs for prefill and decode), pure TP, and sidecar workers (logical leaders). tests/test_benchmarks.py passes apart from failures that also occur on main; ruff check and ruff format pass on src/srtctl. Verified end to end on a GB300 DeepSeek-V4 disaggregated run (DEP8 prefill, DEP16 decode): AIPerf scrapes all 12 worker processes instead of 5 leaders.
weireweire
requested review from
alec-flowers,
csahithi,
ishandhanani and
nlevin-ui
as code owners
October 1, 2026 06:29
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #554 +/- ##
=======================================
Coverage ? 83.96%
=======================================
Files ? 153
Lines ? 21773
Branches ? 0
=======================================
Hits ? 18282
Misses ? 3491
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Custom benchmarks (for example the InferenceX AgentX harness, which wraps AIPerf) receive
AIPERF_SERVER_METRICS_URLSwith logical worker leaders only. With SGLang attention data parallelism, that drops every follower node's DP ranks from the server-side metrics.Root cause
_get_benchmark_envpasseslogical_workers_only=Truefor custom benchmarks, on the assumption that a multi-node worker's follower ranks duplicate the leader's engine. That is true for pure TP. With attention DP (dp-size> 1), each physical SGLang process schedules its own attention-DP ranks and exports distinct cache and load metrics for them. Scraping only the leader therefore covers part of the deployment: on a layout with 2-node DEP8 prefill workers and a 4-node DEP16 decode worker, prefill metrics covered DP0-3 of DP0-7 and decode covered 4 of 16 ranks, so server-side prefix-cache hit rates and load series were computed from a subset of ranks.Fix
_custom_metrics_need_physical_processes(): true when the backend is SGLang, the worker is not a Dynamo sidecar, and any role setsdp-size> 1.SRT_*_ENDPOINTS,SRT_*_IPS) stay logical; pure-TP and sidecar workers keep logical metrics URLs; an explicitAIPERF_SERVER_METRICS_URLSin the recipe environment still wins.Note for reviewers: this raises the number of endpoints AIPerf scrapes per cycle (one per worker node instead of one per worker). AIPerf's
AIPERF_SERVER_METRICS_COLLECTION_INTERVAL(default 0.333 s) sets how often each endpoint is scraped; a worker leader's/metricsresponse can be several hundred KB, so deployments that care about scrape overhead may want a longer interval.Validation
tests/test_benchmarks.py: all new tests pass; remaining failures also occur onmainin the same environment.ruff check src/srtctl/andruff format --checkpass.