Skip to content

Continuous batching, chunked prefill and latency-aware scheduling #56

Open

Description

@zeekay

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.

Benchmark: 1/4/16/64/256 simultaneous requests, long/short mixes, p95 TTFT, inter-token latency, throughput per GPU, SLO completion rate.

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).

Activity

  1. added
    help wanted
    hip-1346
    on Nov 15, 2026
  2. Mramaran commented on Nov 23, 2026

    @Mramaran

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bountyhelp wantedhip-1346p1perfresearch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions