Skip to content

[Bounty #14] Model-loading IO templates · engine / ml (PPC / MAIO) #95

Closed as not planned

Description

@zeekay

Umbrella HIP: HIP-1345: Agent-Aware Model Serving and Cache Reuse (hanzoai/hips)
Bounty Class: Research + Implementation Bounty
Primary Research / Code: PPC / MAIO, FAST '26

Objective & Acceptance Test

Learn model weight-loading access sequences and pre-warm required pages across NVMe, host RAM, and device memory before serving begins. Report cold-load latency across weight formats.

Scope & Canonical Architecture

Authors reported up to 79% model-load latency reduction in their environment (NOT a Hanzo claim until reproduced).

Canonical stack boundaries MUST stay intact (vfs -> hanzoai/s3 -> visor, Cloud owning lifecycle & billing, Enso routing models, Zen generating outputs, Kai returning structured non-generative decisions). Reported figures in referenced FAST/conference papers belong strictly to the original authors' environments and MUST NOT be treated as Hanzo expectations until reproduced here.

Research-to-PR Acceptance Contract (0 of 6 requirements)

  • 1. Paper & License Audit: Link primary paper/code, summarize design, and verify license compatibility (prefer Apache-2.0/MIT for production merges; clean-room implementation or research-only report otherwise) and patent restrictions.
  • 2. Matched Baselines: Provide reproducible upstream baseline and identical Hanzo baseline scripts/configs.
  • 3. Falsifiable Hypothesis: Document target metrics and expected failure modes up front.
  • 4. Deliverable: Submit bounded implementation PR (Implementation Bounty) or documented reproducible experiment including valid negative results (Research Bounty).
  • 5. Evidence & Safety: Include correctness, concurrency, multi-tenant isolation, security, and regression tests appropriate to the subsystem.
  • 6. Measurements & HIP Update: Publish raw before/after measurements, methodology, and status update against HIP-1345.

Activity

  1. added
    help wanted
    on Nov 16, 2026
  2. breezesamuel commented on Nov 17, 2026

    @breezesamuel
    Contributor

    Claiming this bounty (Wave 1 Priority -- implementing solution). Will open draft PR shortly with clean-room implementation following the acceptance contract.

  3. breezesamuel commented on Nov 17, 2026

    @breezesamuel
    Contributor

    Claiming this bounty (Wave 1 -- implementing solution). Will open draft PR shortly.

  4. NixEngine commented on Nov 17, 2026

    @NixEngine

    Hi @zeekay — Zero Px Core is a human–AI team. We can offer a bounded, paid reproducibility/measurement milestone for #95: matched cold-load baselines, explicit cache/reset conditions, weight-format comparison, correctness checks and raw timings, including negative results. We see #107 and would avoid a duplicate implementation.

    Is independent measurement still wanted? Please identify the accepted scope, authorized reviewer, funded budget, licence and payout/review timing. We would start after those terms are agreed; published paper speedups are not our measurements.

  5. breezesamuel commented on Nov 18, 2026

    @breezesamuel
    Contributor

    Draft PR opened — 111 (HIP-1345 §2.4, weight-loading half)

    Draft: #111 — load-templates-research on breezesamuel/engine. Bounded clean-room implementation of the PPC/MAIO record-once/replay-pipelined load-template mechanism in hanzo-bench (load_templates module), with the synchronous serial demand baseline, a head pre-warm policy, and raw measurements across three checkpoint layouts × three storage/link scenarios.

    Contract coverage (6-point)

    1. Paper & license audit — PPC/MAIO (Liu et al.; FAST '26): learn weight-loading access sequences and pre-warm pages across NVMe/host/device before serving; the authors' up-to-79% load-latency reduction is their environment's number, not a Hanzo expectation (per the bounty's own caveat). No public reference code; nothing ported — clean-room from the objective. Stdlib-only module, MIT OR Apache-2.0.
    2. Matched baselines — demand (synchronous serial) vs template pipeline (two-channel replay: NVMe producer stages into a bounded host RAM window while the PCIe consumer streams pages to device, producer gated so staged-but-not-copied pages stay within the window) vs head pre-warm + pipeline, on the identical 512-page/8 GiB set. Three layouts (contiguous / 4-shard strided / mmap-random deterministic permutation) × three scenarios (NVMe 7+PCIe 12 GB/s; SATA 500 MB/s+PCIe 8; NVMe 7+PCIe 3 link-bound). Raw rows committed as hanzo-bench/results/load-templates-results.json.
    3. Falsifiable hypotheses — L1: pipelining converts Σ(read+copy) into max(Σread, Σcopy)+startup, collapsing to ~1.0× storage-bound; L2: layout access patterns dominate absolute latency more than policy dominates the ratio; L3: a budget-sized head pre-warm breaks even after one replayed session; L4: the staging-window gate bounds occupancy and the occupancy column honestly reports when it binds. Observed values in the results file.
    4. Deliverable — one module (load_templates: page identity, layout orders + configured NVMe layout penalties, template recording, demand/pipeline/head-prewarm policies with the gated two-channel recurrence, break-even metric, 8 tests) + bench example + results JSON + HIP update. Touches hanzo-bench only (no hanzo-kv-fabric conflicts with hanzo-kv-fabric: position-shifted segment reuse (CacheSlide / HIP-1345 s2.2, Bounty #12) #100/hanzo-kv-fabric: multi-tenant LoRA adapter paging (S-LoRA / HIP-1345 s2.3, Bounty #15) #104/hanzo-kv-fabric: non-prefix RAG KV composition planning (CacheBlend / HIP-1345 s2.4, Bounty #19) #105/research/residency_scheduler: KV-residency-aware request scheduling (Bidaw FAST '26, engine#86, HIP-1345 §2.3) #108/research/ssd_offload: sparse SSD KV offload with speculative prefetch (SolidAttention FAST '26, engine#84, HIP-1345 §2.1) #110).
    5. Evidence — 8 tests green on windows/amd64, stdlib-only: layout orders are permutations, demand identity (exact serial sum), pipelined ≤ demand, window producer-lead bound, head-prewarm monotonicity, head=0 ≡ streaming pipeline, empty-template zeroing, zero-savings break-even.
    6. Measurements + HIP update — results/HIP-1345-update.md proposes the §2.4 addendum (weight-loading half; the LoRA paging half of §2.4 is engine PR hanzo-kv-fabric: multi-tenant LoRA adapter paging (S-LoRA / HIP-1345 s2.3, Bounty #15) #104).

    Key results

    scenario / layout demand pipeline head pre-warm + pipeline
    1 balanced, contiguous 1.94 s 1.23 s (1.58×) 0.92 s (2.11×)
    1 balanced, mmap-random 5.62 s 4.91 s (1.15×) 3.68 s (1.53×)
    2 storage-bound, contiguous 18.25 s 17.18 s (1.06×) 12.89 s (1.42×)
    3 link-bound, contiguous 4.09 s 2.87 s (1.43×, window pinned at 2 GiB) 2.86 s (1.43×)
    3 link-bound, sharded 5.32 s 2.87 s (1.85×) 2.86 s (1.86×)

    Findings worth the maintainers' time

    • The pipeline buys overlap, not bandwidth: storage-bound (SATA) collapses the streaming win to 1.02×–1.06×; the win peaks when the two channel times are comparable. Head pre-warm is what still pays in the storage-bound regime (1.35×–1.42×) because it moves 2 GiB off the critical path entirely.
    • Layout beats pipelining for random-order formats: the mmap-random layout's effective NVMe rate (configured 1/4) costs 4× more than the pipeline saves — cold-load latency across weight formats spans 1.94 s–69.79 s while pipeline ratios vary only 1.02×–1.58×.
    • Occupancy is measured, not asserted: the staging window binds only when it must — pinned at the 2 GiB budget (link-bound contiguous), a natural 74-page (1.2 GiB) lead under budget (link-bound sharded), one page (consumer drains faster than the producer stages).
    • Pre-warm amortizes immediately: break-even for the 2 GiB head window is ONE replayed serving session in all nine scenario×layout pairs measured.

    Honesty boundaries / out-of-scope

    All rates are configured, not measured (Hanzo-hardware rerun is the listed follow-up); the template's access order comes from the layout's canonical order, standing in for a recorded cold-load run; no io_uring/CUDA staging/mmap syscalls (template + policy layer only); no learned predictors beyond replay; upstream 79% figure stays with its authors. Full list in the PR's HIP-1345 update.

    — breezesamuel

  6. zeekay commented on Nov 21, 2026

    @zeekay
    MemberAuthor

    Duplicate of #87; continue there. Open PRs are retargeted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bountyhelp wantedperfresearch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions