From ca84d52b781f57f822790dd8e3448354636de80d Mon Sep 17 00:00:00 2001 From: Jia-Wei Jiang <36886416+JiangJiaWei1103@users.noreply.github.com> Date: Wed, 17 Jun 2026 08:07:19 +0800 Subject: [PATCH] [Router] [Docs] Refresh policy-selection notes (#28321) Signed-off-by: JiangJiaWei1103 --- experimental/sgl-router/BENCHMARKS.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/experimental/sgl-router/BENCHMARKS.md b/experimental/sgl-router/BENCHMARKS.md index f3bf2bda1..eae4fbd8a 100644 --- a/experimental/sgl-router/BENCHMARKS.md +++ b/experimental/sgl-router/BENCHMARKS.md @@ -62,12 +62,13 @@ latency p50 ≤ 1.10× SMG` acceptance criterion targets. | Policy | n=4 workers | n=16 | n=64 | n=256 | SMG equivalent | |---|---|---|---|---|---| | `round_robin` | 2.5 ns | 2.5 ns | 2.5 ns | 2.5 ns | SMG round-robin is O(1) — same shape. | -| `random` | 16 ns | 36 ns | 137 ns | 471 ns | SMG random is also O(1) per `rand::random()` call; sgl-router's variant grows with n because it `Vec::iter().nth(idx)`. **Action item:** drop sgl-router to O(1) by indexing the slice directly. | -| `power_of_two` | … | … | … | 1.75 µs at n=256 | SMG power-of-two-choices is identical in shape (2× rand + 2× load read). | +| `random` | — | — | — | — | `SliceRandom::choose` call — O(1), matching SMG's O(1) `rand::random()` call. | +| `power_of_two` | — | — | — | — | Two distinct indices sampled directly - O(1), matching SMG's shape (2× rand + 2× load read). | -The `random` finding (linear in worker count) is a real follow-up — file -an issue and pair it with a Criterion regression-guard in the same -bench. +Both `random` and `power_of_two` are now O(1), ensuring consistent +performance regardless of worker count. +TODO: Add a regression guard for the O(n) shape. Although `policy_select` +measures the metric, nothing currently runs or gates on these results. ## Pre-deprecation calibration runbook