Skip to content

perf(storage): restore l1 prefix save admission performance - #90

Open
GentleCold wants to merge 8 commits into
masterfrom
perf/l1-prefix-save-admission
Open

GentleCold wants to merge 8 commits into
masterfrom
perf/l1-prefix-save-admission

Conversation

@GentleCold

Copy link
Copy Markdown
Owner

Summary

  • Restore bounded contiguous store staging spans and re-enable io_uring store coalescing so cold saves use large physical writes again.
  • Keep L1 replacement/headroom changes, but remove stale slot-level physical admission plumbing that made cold performance regress.
  • Update connector, IPC, and io_uring transfer tests for the coalesced store path.

Motivation

The previous prefix-aware L1 attempt split each prompt save into per-slot physical L1/store admission. In evict-mode benchmarks this pushed DaseR cold TTFT from the expected ~2.8s range to ~3.7s. The root cause was the cold save path, not the warm load path.

This PR restores the cold path to contiguous physical spans while keeping the replacement policy pluggable for future logical prefix-aware work.

Test plan

  • Unit tests added / updated
  • PYTHONHASHSEED=0 pytest -q -m "not integration" --ignore=tests/integration --ignore=tests/connector/test_daser_connector.py --ignore=tests/connector/test_gds_transfer.py tests/ passes
  • Integration tests run, or marked N/A with reason
  • Benchmark / e2e smoke run, or marked N/A with reason
  • pre-commit run --all-files passes

Ran:

/data/zwt/vllm/bin/pytest -q tests/transfer
/data/zwt/vllm/bin/pytest -q tests/server/test_ipc_server.py tests/connector/test_daser_connector.py
/data/zwt/vllm/bin/pytest -q tests/transfer tests/server/test_ipc_server.py tests/connector/test_daser_connector.py -k "iouring or replacement or build_staging_store_batches or transfer_store_preserves_span_order or get_finished"
/data/zwt/vllm/bin/ruff check
git diff --check

Results:

  • tests/transfer: 40 passed
  • tests/server/test_ipc_server.py tests/connector/test_daser_connector.py: 124 passed
  • focused regression: 51 passed
  • ruff check: passed
  • git diff --check: passed
  • commit hook: ruff check and ruff format passed

Evict-mode benchmark, Qwen3-8B, 200 prompts, input 8192, output 1, max concurrency 8:

backend cold TTFT mean warm TTFT mean
baseline 2636.12 ms -
LMCache 2861.39 ms 356.93 ms
DaseR prefix 2841.65 ms 298.83 ms

DaseR metrics from the same run:

  • cold store duration sum: 5.354s
  • warm load duration sum: 9.815s
  • warm L1 hits / misses: 152 / 48
  • external prefix hit ratio: 0.99988
  • cold/warm exact match: 197 / 200 = 0.985

Large benchmark store files were removed after the run.

Checklist

  • pre-commit run --all-files passes
  • Type hints and docstrings on all new/modified functions
  • New features and bug fixes include tests
  • No regressions — existing tests still pass

- emit store staging spans from request suffix to prefix

- preserve io_uring store span order across IPC

- update connector and IPC tests for suffix-first admission
- evict normal io_uring stores at an aligned 80 percent save target

- let L2 miss promotion use full L1 capacity and evict by LRU when full

- cover save headroom and promotion eviction behavior
- restore physical store staging to prefix order

- keep one store span per slot for L1 replacement metadata

- update connector staging expectations
- add prefix-aware LRU ordering for request slot groups

- trim save admission after insertion so suffix slots can be evicted first

- mark L2 promotions as headroom entries and evict promoted headroom first

- cover suffix-first trim and promotion headroom behavior
- reserve about five percent of L1 for promotion instead of twenty percent

- trim grouped store admission once after the group is inserted

- update transfer tests for the smaller promotion headroom
- Batch adjacent grouped-store L2 writes behind one pending task while preserving per-slot L1 entries.

- Keep per-slot pending buffers for load correctness and eviction lifetime tracking.

- Add focused coverage for grouped-store L2 write batching.
- Release finished requests once KV has been copied into store staging buffers.

- Keep store and commit futures tracked in the existing background save queue.

- Update worker completion tests for background commit reporting.
- Restore bounded contiguous store staging spans for cold save performance.

- Re-enable io_uring store coalescing so IPC keeps large physical writes.

- Remove stale slot-level L1 admission plumbing and update focused tests.
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