Skip to content

Feature request: serve concurrent requests (cross-request batching) #465

Closed

Description

@Viachtik

With several clients on one GPU (orchestrator agent + sub-agents, a chat bot) everything queues: /v1/status reports concurrency.serving: 1, and DETAILS.md lists "one request at a time" as a v1 limit.

Request: batch decode steps across a few concurrent requests (even 2-4 slots), like llama.cpp --parallel.

Setup: RTX 3090 24 GB + 62 GB RAM, IQ3_S, 262K ctx, OpenCode multi-agent pipeline. Thanks!

Activity

  1. Niko1221 commented on Oct 2, 2026

    @Niko1221
    Owner

    Thanks for the request. Strata runs one sequence at a time by design: decode is limited by reading experts from RAM and over PCIe, and the engine keeps one sequence's state (KV, the draft layer, the conversation checkpoints) per process. Batching requests across users would mean rewriting the decode loop for several slots, with a shared expert cache and per-slot drafting. That is a large change, with limited gain while expert reads are the bottleneck. So it's not planned for now; requests queue and run in order. Closing; the request stays here for later.

  2. added 9 commits that reference this issue on Oct 4, 2026
  3. Niko1221 commented on Oct 4, 2026

    @Niko1221
    Owner

    Planned after all: 0.1.39 has it as an opt-in. "parallel": N in strata-<model>.json (or setup --parallel N) decodes up to N requests together in the engine's batch slots; more wait for a free slot. A request alone still runs the usual path with MTP drafts (and goes back to it when the others have finished); with two or more, each slot decodes one token per window and the weights are read once for all of them. A new prompt is read chunk by chunk with the other slots decoding in between, a long prompt gives way to a much shorter waiting one, and each slot keeps its conversation for the next turn. Each slot's session (0.56 GiB at 32K) comes out of the expert cache, so setup recommends parallel only where the experts mostly fit in VRAM (about 24 GB and up on one card for Q2_0, or a multi-GPU split); elsewhere it stays at one at a time, and --parallel N is still honoured as asked.

    Measured on an RTX 5070 (12 GB) with Q2_0, 4 requests at once: the last one starts after 1.8 s instead of 11.2 s, but together they decode at 63 tok/s against 71 one after the other, and a request alone is 11-24% slower (the slots' VRAM comes out of the expert cache). On a card where most experts run on the CPU the slots buy waiting time, not speed. A card that holds more of the experts in VRAM may do better; we have not measured one yet. Details and limits: docs/BATCHING.md. The engine part is PR #559 by blange48.

  4. 41 remaining items

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions