Skip to content

feat(concurrency): concurrent paged serving - #594

Open
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/concurrent-paged-serving
Open

feat(concurrency): concurrent paged serving#594
Graffioh wants to merge 1 commit into
Luce-Org:mainfrom
Graffioh:codex/concurrent-paged-serving

Conversation

@Graffioh

@Graffioh Graffioh commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Dependency

Builds on #555, which provides the paged K/V allocator, paged-attention operator, and single-request Qwen paged-decode foundation.

Summary

Adds concurrent paged serving for Qwen behind the existing paged-attention path.

  • Introduces model-neutral SeqEngine, StepPlan, and StepResult contracts.
  • Adds scheduler-owned admission, fair automatic prefill distribution, request retirement, cancellation handling, and slow-client buffering.
  • Derives idle and mixed prefill capacity from engine-advertised limits instead of exposing scheduler-internal token-budget flags.
  • Batches live Qwen decode rows and supports fused prefill/decode lowering.
  • Stores recurrent state per sequence with explicit row-to-slot mapping.
  • Reserves prompt capacity atomically and derives paged-K/V capacity from available memory.
  • Adds host, kernel, contract, and end-to-end parallel-serving coverage.
  • Extends CI to exercise concurrent-serving kernels while retaining current DeepSeek4 coverage.

Impact

Multiple requests can share one Qwen backend without run-to-completion serialization. Slot lifecycle, paged K/V ownership, recurrent state, sampling state, and response delivery remain isolated per request.

The normal serving interface stays small: users select maximum concurrency and may override K/V pool capacity, while the engine supplies appropriate idle and mixed prefill limits automatically.

Validation

  • git diff --check
  • test_seq_batch_plan: 41 checks passed
  • Full HIP test_server_unit target built successfully for gfx1151
  • Focused server configuration and /props tests passed
  • CUDA configuration from current main
  • Focused CUDA build progressed through the modified core and concurrent-serving kernel sources without errors; the full GPU template build was not completed locally

TODO future

  • shared paged prefixes

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 64 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/server/scheduler.cpp
Comment thread server/deps/llama.cpp/ggml/src/ggml-cuda/set-rows.cu
Comment thread server/src/server/server_main.cpp Outdated
Comment thread server/src/common/seq_slot_manager.cpp Outdated
Comment thread server/deps/llama.cpp/ggml/include/ggml.h
Comment thread server/CMakeLists.txt
Comment thread server/src/common/backend_args.h Outdated
Comment thread server/src/common/seq_step_validation.h Outdated
Comment thread server/test/test_client_send_buffer.cpp Outdated
Comment thread server/test/seq_engine_contract.h Outdated
@Graffioh
Graffioh force-pushed the codex/concurrent-paged-serving branch 3 times, most recently from 7a84ce1 to e785eeb Compare August 10, 2026 12:25
Comment thread README.md Outdated
@Graffioh
Graffioh force-pushed the codex/concurrent-paged-serving branch 6 times, most recently from 09e7938 to 7270fd0 Compare August 11, 2026 09:13

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 67 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread server/src/qwen35/graph_builders.cpp
Comment thread server/src/server/http_server.cpp
Comment thread server/src/server/server_main.cpp Outdated
Comment thread server/src/qwen35/qwen35_backend.h Outdated
Comment thread server/src/internal.h
Comment thread server/test/test_batched_gdn.cpp
Comment thread server/src/server/server_main.cpp Outdated
Comment thread .github/workflows/ci.yml
Comment thread server/src/qwen35/concurrency/qwen35_slot_manager.cpp
Comment thread server/src/qwen35/concurrency/qwen35_slot_manager.cpp Outdated
@Graffioh
Graffioh force-pushed the codex/concurrent-paged-serving branch from 7270fd0 to b7cfd24 Compare August 13, 2026 15:10
@Graffioh
Graffioh force-pushed the codex/concurrent-paged-serving branch from b7cfd24 to 7eae5fe Compare August 14, 2026 14:05
@Graffioh Graffioh changed the title feat(serving): concurrent paged serving feat(concurrency): concurrent paged serving Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant