Repository navigation
research/load_templates: weight-loading IO templates with pipelined pre-warm (PPC/MAIO FAST '26, engine#87, HIP-1345 §2.4) - #111
Conversation
…re-warm (PPC/MAIO FAST '26, engine#95, HIP-1345 §2.4) Bounded clean-room implementation of the record-once/replay-pipelined load-template mechanism in hanzo-bench: - 16 MiB weight-page identity; canonical page access orders for three checkpoint layouts (contiguous / 4-shard strided / mmap-random deterministic permutation) with configured layout NVMe penalties (1/2 strided, 1/4 random) - LoadTemplate recording (record-once) + two replay policies: demand (synchronous serial NVMe->host->device baseline) and the two-channel pipelined 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 - head_prewarm: stage the first 2 GiB of the learned order in the idle window before serving (head capped by the staging budget) + pipeline the tail; break_even_turns amortization metric - 8 tests: layout orders are permutations, demand identity, pipelined <= demand, window producer-lead bound, head monotonicity, head=0 == streaming pipeline, empty-template zeroing, zero-savings break-even; stdlib-only module - results/load-templates-results.json: demand vs pipeline vs head pre-warm on the identical 512-page/8 GiB set, three layouts x three scenarios. Streaming pipeline 1.02x-1.85x, head pre-warm 1.35x-2.11x vs demand; break-even for the window = ONE replayed session in all nine pairs. Occupancy column reports when the window actually binds (pinned 2 GiB link-bound contiguous; natural 74-page lead sharded; one page consumer-drains) - findings: the pipeline buys OVERLAP not bandwidth (storage-bound regime collapses to 1.0x); layout access patterns dominate absolute cold-load latency (1.94s-69.79s demand span) more than policy affects the ratio - results/HIP-1345-update.md: proposed §2.4 addendum (weight-loading half; LoRA paging half = PR hanzoai#104) + explicit out-of-scope statement (no io_uring/CUDA staging/mmap syscalls; no learned predictors; configured rates until the Hanzo-hardware rerun) - Upstream 79% load-latency-reduction figure remains the authors' own per the bounty caveat; no reference code exists to port - clean-room from the objective
|
Not merged. #87 asks for cold-load latency across NVMe, host RAM and device memory; here every rate is configured (7 and 0.5 GB/s NVMe, PCIe links, layout penalties) and the template order stands in for a recorded load, so the table restates sum against max of those constants and nothing is loaded. Missing: a cold load of a real checkpoint through the engine's loader as the baseline, the access order recorded from that run, the pipelined or head-warmed load timed against it on the same files, and the loader calling the module (it sits in hanzo-bench and nothing uses it). I did not build it here: hanzo-bench pulls hanzo-engine, and fork PRs get no CI. |
|
Closing stale draft simulation harness (last commit 2026-11-18, no follow-up since the 2026-11-21 review). Remaining acceptance criteria for #87:
Feel free to reopen or file a fresh PR once those real-loader measurements and wiring are in place. |
Summary
Research deliverable for #87 ([Bounty #14] Model-loading IO templates, PPC/MAIO FAST '26, HIP-1345 §2.4): a bounded clean-room implementation of the record-once/replay-pipelined load-template mechanism in
hanzo-bench(load_templatesmodule), with the synchronous serial demand baseline, a head pre-warm policy, raw measurements across three checkpoint layouts × three storage/link scenarios, the HIP-1345 §2.4 status update, and an explicit out-of-scope statement.Contract coverage (6-point)
hanzo-bench/results/load-templates-results.json.hanzo-bench/src/load_templates.rs(page identity, layout orders + configured NVMe layout penalties,LoadTemplaterecording, demand/pipeline/head-prewarm policies with the gated two-channel recurrence, break-even metric, 8 tests) +hanzo-bench/examples/load_templates_bench.rs+ results JSON + HIP update. Bounded: one module, one example, no engine changes.cargo testgreen on windows/amd64; module is stdlib-only.results/load-templates-results.json;results/HIP-1345-update.mdproposes the §2.4 addendum (weight-loading half; the LoRA paging half is engine PR hanzo-kv-fabric: multi-tenant LoRA adapter paging (S-LoRA / HIP-1345 s2.3, Bounty #15) #104) and carries the out-of-scope statement.Key results
Findings worth the maintainers' time
Honesty boundaries
Draft PR — happy to rebase or restructure per maintainer preference. (Note: #100/#104/#105/#108/#110 touch
hanzo-kv-fabric; this one toucheshanzo-benchonly, so it is merge-independent.)