Repository navigation
Commit 0a31c5d
Insert missing shared payloads into the package cache concurrently
A DeepSeek V4.1 TP3 export on three GB10 nodes spent 645 s in "Verify
and publish shared data" for 202.8 GB, mostly two Engram tables of about
91.6 GiB each read from checkpoint spans. The ordered loop copied each
payload into the cache and hashed the written object one at a time, with
one process at about 50% CPU and the NVMe alternating between 670 MB/s
read+write and 1 GB/s read-only.
For cache publication, the shared payloads whose objects are missing are
now inserted before the ordered loop on the same bounded, largest-first
workers as the source verification pass. Each insertion is the loop's
former miss path: check the source, Root::insert_payload, which hashes
the stream as it is written and then the installed object, and compare
the object identity. Payloads that are already located, reused cached
weights, no-weights weights, already cached, or repeated identities are
left to the ordered loop. The ordered loop still does all staging links,
locations, catalog entries, and progress in declaration order; it finds
the installed objects and skips a second hash only when the cached file
is the same inode span this export installed and verified. Any other
cached object is hashed as before. The first worker error stops
scheduling and is returned after running insertions finish.
Concurrent insert_payload calls for distinct identities use distinct
transaction tokens, staging files, and per-object flock leases, and only
share the publication lock in shared mode.
Validation: helios tests with runtime-package,server on aarch64 CPU
(1168 passed, 24 ignored, against 1167 for the parent; the only failures
are 7 server::protocol tests that also fail on main); heliopause: 166 passed. The new
test publishes four shared payloads (two weight tables, a repeated
identity from another file, and an already cached state) into a cache
and checks one verified object per identity, envelope, locations and
catalog order equal to the serial directory publication, and rejection
of a corrupted source both through the source pass and through the
concurrent insertion when cached weights are reused.
Measured on the same three GB10 nodes, model, recipe flags and cold forward
cache: "Verify and publish shared data" took 426.9 s with this change,
against 645.2 s for the parent and 863.7 s for ca1f960; "Export native
packages" took 1677.4 s, against 1855.3 s and 2578.6 s. That export also used
16 transfer streams, which did not change the receive time (477.2 s against
457.8 s). The package served normally.
Limitations: one export measured per configuration. After a
failure, payloads inserted by other workers remain as verified,
unreferenced cache objects until collection; no entry is published.
Design-Signed-Off-By: Claude Opus 5.5; design-review=1c01
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lxs9D6n8jS5mrwsfSzQ5ZE
Signed-off-by: Javier López <59578422+javieratomic@users.noreply.github.com>1 parent 72009f2 commit 0a31c5d
1 file changed
Lines changed: 418 additions & 46 deletions
0 commit comments