You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Continuous batching, chunked prefill and latency-aware scheduling #56
A fast single-user runtime can waste most GPU capacity under simultaneous requests. Token-budget scheduling with chunked prefill, decode prioritisation, admission control and KV-aware batching; prefill is compute-heavy and decode bandwidth-heavy, so the scheduler accounts for both. Keep single-user latency targets separate from datacenter throughput settings.
Scorecard for every run: cold and warm TTFT, p50/p95 inter-token latency, full agent-loop wall time, peak memory, energy per token, output correctness, quality regression. Record GPU/NPU/CPU architecture, driver, quantization format and commit. Use the shared 4B/9B/27B matrix and the 20-turn coding-agent benchmark; reject changes that win a microbenchmark but regress end-to-end inference. Published speedups are not assumed to transfer to our models without measurement. Licensing: reuse Apache-2.0/MIT sources with attribution; study-only references (non-commercial, unlicensed, papers) get an independent implementation. Open for community research: comment to claim, publish method and raw numbers (bounty; reward terms are set by the maintainers on the issue).
On main, PagedAttentionScheduler::schedule() in hanzo-engine/src/paged_attention/scheduler.rs returns a prompt-only batch whenever a waiting sequence can be admitted, and the 4096-token chunk loop in pipeline/mod.rs runs all chunks of that prompt in one step. So every running sequence stops decoding until the whole prefill is done. hanzo-bench serving doesn't show it, since it only reports per-request mean TPOT.
I'd like to take a first slice of this, as two PRs. First, per-token inter-token latency in serving (p50/p90/p99 plus each request's worst gap), with baseline numbers posted here. Second, an opt-in per-step prefill token budget that only kicks in while something is decoding. A long prompt then prefills over several steps with decode steps in between, and only its last chunk samples. When nothing is decoding, prefill works as it does today, so single-user TTFT stays the same. Fusing prefill and decode into one forward pass isn't part of this.
For correctness, I'll add long prompts to --identity and check for cross-sequence contamination with the budget on and off. A sequence that gets preempted mid-prefill should only cache the blocks it actually wrote, so I'll test that too. I'm on an RTX 4060 Laptop (8 GB), so numbers will be Qwen3-4B Q4_K_M at 1/4/16 concurrent requests, plus 64 if the KV cache fits.
Should hybrid GDN models stay on the current single-step prefill for this slice, or do you want recurrent state carried across steps too?
Activity
Mramaran commentedon Nov 23, 2026
On main,
PagedAttentionScheduler::schedule()inhanzo-engine/src/paged_attention/scheduler.rsreturns a prompt-only batch whenever a waiting sequence can be admitted, and the 4096-token chunk loop inpipeline/mod.rsruns all chunks of that prompt in one step. So every running sequence stops decoding until the whole prefill is done.hanzo-bench servingdoesn't show it, since it only reports per-request mean TPOT.I'd like to take a first slice of this, as two PRs. First, per-token inter-token latency in
serving(p50/p90/p99 plus each request's worst gap), with baseline numbers posted here. Second, an opt-in per-step prefill token budget that only kicks in while something is decoding. A long prompt then prefills over several steps with decode steps in between, and only its last chunk samples. When nothing is decoding, prefill works as it does today, so single-user TTFT stays the same. Fusing prefill and decode into one forward pass isn't part of this.For correctness, I'll add long prompts to
--identityand check for cross-sequence contamination with the budget on and off. A sequence that gets preempted mid-prefill should only cache the blocks it actually wrote, so I'll test that too. I'm on an RTX 4060 Laptop (8 GB), so numbers will be Qwen3-4B Q4_K_M at 1/4/16 concurrent requests, plus 64 if the KV cache fits.Should hybrid GDN models stay on the current single-step prefill for this slice, or do you want recurrent state carried across steps too?