Skip to content

research/residency_scheduler: KV-residency-aware request scheduling (Bidaw FAST '26, engine#86, HIP-1345 §2.3) - #108

Closed
breezesamuel wants to merge 1 commit into
hanzoai:mainfrom
breezesamuel:residency-scheduler-research
Closed

breezesamuel wants to merge 1 commit into
hanzoai:mainfrom
breezesamuel:residency-scheduler-research

Conversation

@breezesamuel

@breezesamuel breezesamuel commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Research deliverable for #86 ([Bounty #13] KV-residency-aware scheduling, Bidaw FAST '26, HIP-1345 §2.3): a bounded clean-room implementation of Bidaw's first mechanism — KV-residency-aware request ordering — at the hanzo-kv-fabric scheduling-policy layer, with a deterministic mixed warm/cold workload, its FIFO matched baseline, raw measurements, the HIP-1345 §2.3 status update, and an explicit out-of-scope statement.

Contract coverage (6-point)

  1. Paper & license audit — Bidaw (Hu, Zhang, Zhou, Wei, Zhong, Chen; FAST '26): two-tier KV storage (host memory + SSD) for interactive multi-turn serving; the paper's compute→storage mechanism separates requests by KV-load latency and reorders by KV size. No public reference code exists to our knowledge; nothing was ported — clean-room from the abstract alone. USENIX FAST proceedings are open access; paper copyright stays with the authors. License: MIT OR Apache-2.0 (dual, matching the repo).
  2. Matched baselines — FIFO arrival order (the no-awareness baseline) vs residency order, both run through the identical deterministic sequential-server simulation with the same workload, same per-tier bandwidths, same KV footprints. Both schedules and raw outcomes are committed in hanzo-kv-fabric/results/residency-scheduler-results.json.
  3. Falsifiable hypotheses (pre-declared) — S1: FIFO p95 TTFT under a mixed warm/cold queue is dominated by cold-load head-of-line blocking (expected failure: uniform load latencies would make ordering irrelevant); S2: residency order reduces p95/max TTFT with unchanged total load bytes (expected failure: heavy fast-tier-first bias starves the slow tier — max TTFT is reported to make any starvation visible); S3: the ordering itself costs orders of magnitude less than any real load latency (expected failure: O(n log n) comparisons somehow reaching µs scale). Observed values for all three are in the results file.
  4. Deliverable — hanzo-kv-fabric/src/residency_scheduler.rs (tier model, ordering policy, sequential-server simulation, 5 tests) + hanzo-kv-fabric/examples/residency_bench.rs (the workload + both schedules) + results JSON + HIP update. Bounded: one module, no engine integration, no lib changes beyond the module declaration.
  5. Evidence — 5 tests: tier-then-size ordering lock, resident-tier zero-load invariant, simulation determinism + accounting identity (ttft = wait + load + prefill), residency-beats-FIFO on the cold-head-of-line case, empty-input zeroing. cargo test green on windows/amd64; stdlib-only (no new dependencies).
  6. Measurements + HIP update — raw numbers in results/residency-scheduler-results.json (p50/p95/p99/max TTFT per policy, goodput, ordering cost); results/HIP-1345-update.md proposes the §2.3 status addendum and carries the out-of-scope statement.

Key honesty boundaries

Draft PR — happy to rebase or restructure per maintainer preference.

lib.rs note

hanzo-kv-fabric/src/lib.rs gains one pub mod residency_scheduler; line. If #100/#104/#105 merge first, this PR rebases cleanly on their merged lib.rs.

…Bidaw FAST '26, engine#94, HIP-1345 §2.3)

Bounded clean-room implementation of Bidaw's first mechanism
(compute -> storage awareness) at the fabric scheduling-policy layer:

- ResidencyTier (Resident/Host/Ssd) + SchedRequest + tier-ranked
  smallest-KV-first ordering (stable sort, deterministic)
- Sequential-server simulation with per-tier load bandwidths and
  prefill compute rate; reports mean/p50/p95/max TTFT, per-tier
  worsts, goodput (max TTFT reported as order-invariant, honestly)
- 5 tests: ordering lock, resident zero-load invariant, determinism
  + accounting identity, residency-beats-FIFO on cold head-of-line
  (mean + warm-wait), empty-input zeroing; stdlib only
- results/residency-scheduler-results.json: FIFO vs residency on the
  identical 24-request mixed warm/cold workload (8 resident / 8 host
  / 8 SSD, 16 MiB..2 GiB), two SSD-bandwidth scenarios; raw numbers
- results/HIP-1345-update.md: proposed §2.3 status addendum
  (single-node half; the Enso/distributed half is cloud PR hanzoai#48) +
  explicit out-of-scope statement (mechanisms 2-3, real I/O,
  batching, admission control, hanzoai#56 integration)
- Upstream Bidaw figures remain the authors' own per the bounty
  caveat; no reference code exists to port - clean-room from the
  abstract
@zeekay

zeekay commented Nov 21, 2026

Copy link
Copy Markdown
Member

cargo test -p hanzo-kv-fabric fails to compile at this head: examples/residency_bench.rs imports hanzo_kv_residency, which is not a crate. Please fix the import so the bench reproduces residency-scheduler-results.json.

@zeekay zeekay changed the title research/residency_scheduler: KV-residency-aware request scheduling (Bidaw FAST '26, engine#94, HIP-1345 §2.3) research/residency_scheduler: KV-residency-aware request scheduling (Bidaw FAST '26, engine#86, HIP-1345 §2.3) Nov 21, 2026
@zeekay

zeekay commented Nov 21, 2026

Copy link
Copy Markdown
Member

Closed: #109 implements the scheduler in hanzo-router and reproduces its numbers; this one's example does not compile and stays at the policy layer.

@zeekay zeekay closed this Nov 21, 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.

2 participants