← Back to Pull requests

[Feat] activation-monitors: Route features to a per-request scorer owner #2

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Dec 01, 2026 19:16 UTC
Author

Motivation

A disaggregated request can run prefill and decode on different workers while its recurrent probe history lives on one scorer. This extends #54109 so a trusted router can choose that scorer before prefix lookup and keep it for the request attempt.

Modifications

  • Choose an owner before prefill. Configure eligible workers with the same advertised scorer addresses and feature endpoints. In a pool with multiple scorers, set an explicit default for warmup, health checks, and unassigned requests. The in-process router can select any configured owner. Native HTTP selection uses a scoped routing key. The standard generation API key still applies when configured. Configuration and rollout

  • Carry ownership across workers. The tokenizer scopes the existing KV cache salt to the owner and carries the original tenant salt for retries. At handoff, decode checks the owner, tenant and resolved adapter identity. Workers may have different local cache classifications. Mixed-owner batches publish each request’s accepted rows, retractions, retries, terminal events and gaps to its selected scorer in source order. The snapshot, stream and cursor APIs are unchanged.

  • Bound pooled export. Each publishing worker shares one 512 MiB queue budget across all owners by default. One sender thread and one ZeroMQ context service the active owners. Sockets open on first use, and a slow or failed destination is isolated. A mixed batch shares one host readback. With default limits, an owner can queue 256 MiB of ordinary work, burst to 416 MiB for a large prefill and retain up to 448 MiB with follow-on decode work. Fixed-endpoint deployments continue to use the publisher from #54109.
  • Accuracy Tests

    | Check | Result |
    | --- | --- |
    | Registered unit, CUDA and subtests | 403 tests and 336 subtests passed on H200 with zero skips. Includes the exporter, scorer, auth, radix, PD and HiCache suites. |
    | Mixed owners on PD | Two prefills and one decoder served both owners through Mooncake and NIXL/UCX, including real server warmup, cached branches and interleaved requests. The fixed-endpoint aggregate and PD regression tests also passed. |
    | Authenticated re-prefill | Two Mooncake requests each underwent a forced retraction. They returned 180/180 valid output rows per probe and 50/50 or 63/63 valid input rows. Their first output matched their last input. The other scorer returned 404. Wrong-owner and wrong-tenant handoffs returned HTTP 400. |
    | Rolling pool membership | With different pool memberships on prefill and decode, both selected the same explicit default during unassigned generation. All 4 prompt and 12 output scores were valid. |
    | Cache isolation | A second prefill restored 64 tokens from Mooncake L3 with identical archived scores. The same prompt under a foreign owner had zero cache hits. An eviction test also restored 96 tokens from L2 and then L3 with matching scores. |
    | Worker-local keys and adapters | Handoff unit tests accepted different local classifications with matching tenant, owner and static adapter ID. They rejected a different owner, tenant or adapter ID. |

    Run the monitor unit tests with python -m pytest -q test/registered/unit/activation_monitor_sidecar/. The registered mixed-owner PD test is test/registered/e2e/activation_monitors/test_sidecar_pd_owners.py.

    Speed Tests and Profiling

    We ran Beam 1.0 FP8 TP8 with the trained Iris minGRU and DFLASH 2/block 8 on the same eight H200s. C128, cold 1,024-token inputs, 256-token outputs, a 45-second warmup and a five-minute measurement per configuration. The two scorer processes shared model GPUs. The fixed arm routed to one of them. The client continued generating while it checked scores.

    | Routing | Completed / failed | Output tok/s | Change vs fixed | Requests with complete input and output scores by +5 s | P99 time to observe all output scores after generation |
    | --- | ---: | ---: | ---: | ---: | ---: |
    | Fixed endpoint | 4,242 / 0 | 3,619.8 | baseline | 4,242 / 4,242 | 0.381 s |
    | Two scorers, 50:50 | 4,214 / 0 | 3,595.9 | -0.66% | 4,214 / 4,214 | 0.314 s |
    | Two scorers, 90:10 | 4,201 / 0 | 3,584.9 | -0.97% | 4,201 / 4,201 | 0.418 s |

    Each throughput estimate is one run. The deadline is measured from generation completion. Per-token inline delivery requires a separate measurement.

    A separate high-throughput stress test used a deterministic two-layer Qwen3 and a minGRU fixture on one H200 at C128. With random 1-in-32 score reads and cold requests, the client observed complete input and output scores within five seconds on 0/206 sampled fixed-scorer requests, 166/166 with balanced routing, and 13/158 at 90:10. The 13 requests on the lighter-loaded scorer all met the deadline. The busy scorer reported export gaps, and the sample reader observed no HTTP timeouts or 429s. This fixture tests isolation under overload.

    The loopback exporter test delivered 2,000 ordered messages to 500 active owners with one Python sender and two ZeroMQ threads. With 500 configured and two active, only two sockets opened. A stalled or disconnected scorer left its healthy peer delivering all 14 expected messages in each test.

    An earlier tiny Qwen3 B300 test at concurrency 4 measured median output throughput of 1,019 tok/s on Jimmy’s fixed baseline, 1,018 tok/s with the draft’s fixed scorer, and 982 tok/s with two alternating scorers sharing the model GPU.

    An earlier H200 Beam FP8 TP8 / DFLASH 2 run checked the burst cap with 500 configured owners, two active owners, and a 127:1 request split. The largest export job was 381.09 MiB. All 256 requests returned all 1,024 output scores and every sampled prompt score was valid.

    Follow-ups

  • Qualify forced remote re-prefill behind the deployment's ingress. The native HTTP test covers a shared scorer routing key and an ordinary API key on the two PD legs. Remote LoRA re-prefill, session-owned KV and the single-engine recovery helper are outside the named-routing qualification.

  • Follow the documented rollout order across workers and frontends. Keep score-read routes available while old requests drain. A scorer restart or eviction can leave cached KV without matching history.
  • Checklist

  • Format code with pre-commit.

  • Add focused unit and integration tests.

  • Update the configuration and deployment documentation.

  • Provide accuracy tests and speed measurements.

  • Follow the SGLang code style guidelines.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: neilkg Review duration: 2847m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #2"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%
    Repository