Repository navigation
hanzo-kv-fabric: multi-tenant LoRA adapter paging (S-LoRA / HIP-1345 s2.3, Bounty #15) - #104
Conversation
|
Thanks, this is a solid first cut of the S-LoRA paging policy in |
|
Noted — keeping
Will push the follow-up commit to this branch rather than opening a second PR, so the contract is visible in one place. Happy to split it out if you prefer. — breezesamuel |
Follow-up commit pushed — contract completion — head
|
…w-up) Completes the four remaining contract items from review: - Matched baselines: unpinned-LRU (phase A) vs tenant-pinned (phase B) on the identical storm fixture - committed as hanzo-kv-fabric/results/lora-paging-results.json - Raw measurements: 0/2048 (0.0%) unpinned vs 248/256 (96.9%) pinned; evictions 2038 vs 1800; policy cost ~302 ns hit / ~709 ns admission; 8/8 pinned pages survive - HIP-1345 update: results/HIP-1345-update.md proposes the §2.4 status addendum (§2.4 = Bounties hanzoai#14-hanzoai#15; the §2.3 label in the first cycle was a mislabel - §2.3 is Bounties hanzoai#13/hanzoai#18) - section refs corrected in module docs and the bench - Out-of-scope statement: explicit 7-item list (training lifecycle, attention-path hot-swap, device I/O, cross-worker replication, multi-GPU placement, pin-quota arbiter, Bounty hanzoai#14)
Per the live HIP text: Bounties hanzoai#14-hanzoai#15 = §2.4 (LoRA paging), Bounties hanzoai#19-hanzoai#20 = §2.7 (non-prefix RAG KV fusion).
8f31631 to
4525af5
Compare
Bounty #15 (engine#88) — Multi-tenant LoRA paging · fabric policy layer
Refs #88. Phase 1 (bounded) of the S-LoRA integration: the paging policy layer inside
hanzo-kv-fabric, reusing the crate's existing primitives (salted XXH3 keys,thiserror,parking_lot,rustc-hash) and following the review shape of the CacheSlide PR (#100). No device I/O, no attention-path changes, no new dependencies, no workspace changes.1. Paper & License Audit
2. Matched Baselines
Fabric-level (no GPU required): the example's Phase A (unpinned LRU storm) is the baseline; Phase B adds pinning on top of the identical workload. Reproduce:
GPU-side baselines (adapters per GPU, switch latency on real weights, mixed-rank throughput) require a GPU host and are Phase 2.
3. Falsifiable Hypothesis
DeviceMemoryExhausted(pinned pages are never stolen).4. Deliverable (this PR)
hanzo-kv-fabric/src/adapter_paging.rs—AdapterPagingRegistry: salted adapter keys, per-(key, layer)pages, hard device-byte budget, LRU eviction over unpinned residents only, pin/unpin, deregister, registration-time SHA-256 digests carried on every lease.hanzo-kv-fabric/examples/lora_paging_bench.rs— 8 tenants × 2 adapters × 4 layers × 4 MiB pages (256 MiB demand vs 40 MiB budget) standing storm, with and without pinning; reports hit ratios, evictions, and per-bucket policy cost.5. Evidence & Safety
Tests cover: salt separation (tenant isolation), fail-closed config rejection (empty name, zero layers, zero bytes, digest-count mismatch), duplicate registration rejection, hit/LRU bookkeeping, hard-budget eviction accounting, out-of-range and unknown lookups, pinned-vs-storm DoS resistance, unpin restore, deregister budget release, and an 8-thread concurrent storm asserting resident bytes never exceed the budget.
6. Measurements & HIP Update
Raw counters from
cargo run --release -p hanzo-kv-fabric --example lora_paging_bench(8 tenants × 2 adapters × 4 layers × 4 MiB pages = 256 MiB demand vs 40 MiB budget, 32 storm rounds):Reading: the pinned tenant's 248/256 = the 8 first-round admissions (bringing pinned pages resident) followed by 248 consecutive hits — once resident, a pinned adapter is never evicted again, while unpinned tenants thrash at 0.0%. The measured hit/admission costs confirm hypothesis (2).
HIP-1345 §2.4 status update to follow in
hanzoai/hipswhen the scheduler integration (attention-path RoPE translation + real-weight paging) is scoped — intentionally not bundled here to keep this PR bounded and reviewable.Not in this PR (Phase 2+)
Follow-up commit pushed (contract completion): matched-baseline storm table, raw measurements (
0/2048unpinned vs248/256 = 96.9%pinned, evictions2038 → 1800, policy cost~302 nshit /~709 nsadmission) committed ashanzo-kv-fabric/results/lora-paging-results.json; HIP-1345 status addendum proposed inresults/HIP-1345-update.md(§2.4 — the §2.3 label in this description was a mislabel per the live HIP text and has been corrected); explicit out-of-scope statement included.