Skip to content

feat(PR-A3c): batched decode scheduler — 8.45× served multi-tenant throughput + detailed test report - #130

Merged
cursor[bot] merged 2 commits into
mainfrom
AgentMemory/pr-a3c-batch-scheduler-2815
Jun 14, 2026
Merged

feat(PR-A3c): batched decode scheduler — 8.45× served multi-tenant throughput + detailed test report#130
cursor[bot] merged 2 commits into
mainfrom
AgentMemory/pr-a3c-batch-scheduler-2815

Conversation

@FluffyAIcode

Copy link
Copy Markdown
Owner

What

The throughput step for the served multi-tenant path. §3.6 made serving correct multi-tenant (per-session binding) but RPC-serialized. BatchedDecodeScheduler fuses a cohort of per-session adapters' decode steps into one batched verifier forward (stacks their restored caches along the batch dim, drops finished rows) — the served-path realisation of the §3.5 parallel decode.

Result (H200, 8 sessions, NIAH ctx≈1238) ✅

path aggregate decode tok/s per-session recall
serialized (§3.6, each session alone) 26.6 1.0
batched scheduler (§3.7) 224.9 1.0
speedup 8.45×

The served path goes from correct-but-serialized to 8.45× aggregate throughput at 8 sessions, recall preserved — matching the engine-level near-linear scaling, now driven through the served per-session adapters.

Detailed test report

Adds docs/reports/pr-a3c-multitenant-serving-test-report.md — the full PR-A3c multi-tenant record (environment, methodology, all numbers, evidence index) across §3.4 memory A/B (~4.2× agents), §3.5 parallel throughput (8.04×), §3.6 served isolation (recall 1.0), §3.7 batched scheduler (8.45×).

Scope / follow-ups

  • Fixed-cohort batcher (synchronized burst — the dominant case). Dynamic mid-flight arrival + ragged-length continuous batching, and the async-gRPC futures glue (so independent Generate RPC coroutines feed one batch loop), are the remaining productization. Batched fused spec-decode (DFlash batch-1) is separate.

Files

  • inference_engine/session/batch_scheduler.py (new) + tests/.../test_batch_scheduler.py (guard tests)
  • scripts/research/k3_served_batched_scheduler_bench.py (new bench)
  • docs/adr/0014-…md §3.7 + Appendix A; docs/reports/pr-a3c-multitenant-serving-test-report.md (new)
  • results/research/k3_served_batched_scheduler_gpu.json

Testing

  • pytest tests/inference_engine/session/test_batch_scheduler.py (4 passed — guards)
  • ✅ H200: 8 sessions, batched 224.9 vs serialized 26.6 tok/s = 8.45×, per-session recall 1.0
Open in Web Open in Cursor 

cursoragent and others added 2 commits June 14, 2026 07:56
…ode into one batched forward (served-path throughput)

Fixed-cohort batched decoder over PerSessionVerifierRegistry adapters: stacks
the per-session restored caches along batch dim, one verifier forward per step,
drops finished rows. Served-path realization of the §3.5 parallel throughput.
+ bench (batched vs serialized, recall-checked) + guard unit tests.

Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
…t (recall 1.0) + detailed PR-A3c multi-tenant test report

Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
@cursor
cursor Bot merged commit 5e49d43 into main Jun 14, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants