Skip to content
Octopus Research Institute
TR-2026-0019Technical reportPeer review: Not peer reviewedEvidence: ExperimentalStatus: Released

Continuous batching with paged KV: a dependency-free CUDA throughput path

Ran Tao (Octoryn Research)

This is not peer-reviewed. Treat it as a working document, not a validated result.

Abstract

A dependency-free CUDA inference path (no vendor BLAS/DNN/TLAS libraries) adds paged KV caching (a global block pool with per-(layer, sequence) block tables, allocate-on-demand and free-on-exit) plus iteration-level continuous batching. On an idle consumer GPU, batched per-stream argmax output is byte-identical to single-stream decode across small batch and block sizes, and aggregate throughput modestly exceeds single-serial decode. Aggregate is NOT linear in batch and was not benchmarked against an external serving system. This is a correctness smoke test on a layer subset, not a benchmark.

1. Contribution

Claimed. A dependency-free CUDA inference path (no vendor BLAS/DNN/TLAS libraries) implements two throughput mechanisms: paged KV caching (a global block pool with per-(layer, sequence) block tables, blocks allocated on demand and freed on sequence exit) and iteration-level continuous batching (an active set of B sequences run through one batched forward pass, with dynamic exit and block free). On an idle consumer GPU, batched per-stream argmax output is byte-identical to single-stream decode across small batch sizes and several block sizes, and aggregate throughput modestly exceeds single-serial decode.

NOT claimed. This is a correctness-and-engineering validation, not a novel algorithm and not a benchmark-scale throughput result. It does NOT claim linear-in-batch scaling (aggregate stays roughly flat in batch because expert dispatch and the quantized projections still loop per row, leaving per-iteration cost weight-bound). It does NOT claim parity with an external serving system's absolute throughput. It does NOT claim a full-model aggregate number — the test machine holds only a layer subset resident. Argmax parity is a correctness property; it says nothing about generation quality.

2. Methods

FieldValue
HardwareIdle consumer-class NVIDIA GPU with limited (single-digit GB) device memory
Stack / librariesDependency-free CUDA path; the CUDA runtime plus system libraries only — no vendor BLAS/DNN/TLAS libraries
BaselineSingle-stream (serial) decode in the same engine; an external high-throughput serving system was the conceptual target but was not run here
ProcedurePaged KV: global block pool plus per-(layer, sequence) block tables, allocate-on-demand and free-on-exit; a dedicated scatter-write step and a batched paged-attention decode step gather each sequence's KV via its block table. Continuous batching: iteration-level scheduler runs B active sequences through one batched forward (QKV/output projection over B rows, a single batched paged-attention launch, per-sequence router and dispatch). Reuses a resident quantized-int4 weight bank.
Precisionfp32-stable softmax in paged attention; resident weights quantized to int4
Metric + gatePer-stream argmax exact-match versus single-stream (gate: 100% match); aggregate tokens/sec versus single-serial
Stimulus / inputsSmall batch sizes crossed with several block sizes; per-config token counts not individually enumerated beyond exact-match totals

3. Results

ConfigurationMeasurement
Parity, small batch sizes x several block sizesPer-stream argmax 100% match versus single-stream
Aggregate versus single-serialRoughly 1.3-1.4x on every run
Aggregate tokens/sec (flat in batch)Low-three-figure tokens/sec; aggregate stays roughly flat while serial divides per stream
Sovereignty checkCUDA runtime plus system libraries only; no vendor BLAS/DNN/TLAS libraries

4. Threats to validity / Limitations

  • Sample size is a correctness smoke test, not a benchmark. Parity is measured over a handful of batch-by-block configurations on short decode runs. This validates byte-identical output, not throughput at benchmark scale or under realistic mixed-length traffic.
  • Single-run perf, no variance. The speedup and tokens/sec figures are reported as ranges across configs with no repeated trials, confidence intervals, or variance — they are point observations on an idle GPU.
  • Parity is not quality. Argmax exact-match proves the batched/paged path reproduces the single-stream decode bit-for-bit; it says nothing about generation quality or downstream task performance.
  • Scope / scaling ceiling is acknowledged. Aggregate is explicitly NOT linear in batch — expert dispatch and the quantized projections loop per row, so the path is weight-bound. The headline framing must be read against this: no external serving system was run, so the comparison is directional, not measured.
  • Quantization / hardware bound. Results hold for the resident int4 weight bank on a single-digit-GB consumer GPU holding only a layer subset. Full-model aggregate is unmeasured and requires a substantially larger device-memory budget.
  • Oracle/baseline weakness. The baseline is the engine's own single-stream path, which makes parity self-consistent but provides no external throughput reference for the throughput claim.

5. Reproducibility / Provenance

  • Build: compiled with the CUDA toolchain targeting the consumer GPU's architecture, optimized C++17 build.
  • Version pins (CUDA toolkit, driver, model shard): not recorded.
  • Procedure pins (high level): paged KV via a global block pool plus per-(layer, sequence) block tables with allocate-on-demand/free-on-exit; a dedicated scatter-write step and a batched paged-attention decode step with fp32-stable softmax; continuous batching via an iteration-level scheduler over B active sequences; a resident int4 weight bank reused across the path.
  • Sovereignty check: confirm the linked libraries report the CUDA runtime plus system libraries only (no vendor BLAS/DNN/TLAS libraries) before trusting the dependency-free claim.
  • Next levers (not yet done): batched expert GEMM over active rows, prefill chunking, admission control; full-model aggregate on a larger-memory device.

Claim boundary

The author's explicit scope — what this work does and does not establish — carried over from the Octoryn Research publishing model.

Proves

  • A dependency-free paged-KV plus iteration-level continuous-batching path produces per-stream output byte-identical to single-stream decode (argmax 100% match across the tested small batch and block sizes).
  • On an idle consumer GPU, aggregate throughput modestly exceeds single-serial decode.

Does not prove

  • Linear-in-batch scaling: per-row dispatch and quantized projections leave the path weight-bound, so aggregate stays roughly flat in batch.
  • Parity with an external serving system's absolute throughput: no external system was run, so any such comparison is directional only.
  • Full-model aggregate throughput: the test machine holds only a layer subset resident.
  • Generation quality or throughput at benchmark scale: parity is argmax correctness over a few short configurations, a smoke test not a benchmark.
  • Variance or repeatability of the performance figures: they are single-run point observations with no confidence intervals.

Applies when

  • Batched decode of a layer subset on an idle consumer GPU using a resident quantized-int4 weight bank, at small batch and block sizes.

Does not apply when

  • Linear-scaling or external-system parity throughput claims, or full-model aggregate on the test machine.
  • Benchmark-scale or mixed-length traffic, or any generation-quality claim.
  • Hardware or memory budgets beyond the idle consumer-GPU layer-subset setup, or non-quantized weight paths.

Authors

  • Ran Tao — Investigation, Writing

Cite this

Citation

Tao, R., Octoryn Research. (2026). Continuous batching with paged KV: a dependency-free CUDA throughput path (TR-2026-0019). Octopus Research Institute.

BibTeX

@techreport{oritr20260019,
  title       = {Continuous batching with paged KV: a dependency-free CUDA throughput path},
  author      = {Tao, Ran and {Octoryn Research}},
  institution = {Octopus Research Institute},
  year        = {2026},
  note        = {Permanent ID TR-2026-0019. Not peer reviewed.}
}

Disclosures

Funding
Hardware and infrastructure provided by Octoryn / Octopus Core Pty Ltd.
Conflicts of interest
Octoryn ships commercial inference and governance tooling; findings are reported independently.