Skip to content

Delta apply: read bytes the base holds at other offsets from its files (prefill after decode: store reads 9.47 → 1.93 GB) (#58) - #60

Merged
gspark-etri merged 3 commits into
mainfrom
feat/base-local
Oct 22, 2026
Merged

gspark-etri merged 3 commits into
mainfrom
feat/base-local

Conversation

@gspark-etri

Copy link
Copy Markdown
Contributor

Background

Delta apply (#41) only keeps bytes that sit at the same offset in the base. When a variant holds the same bytes at other offsets, the pull fetched them although the node had them (#58):

Changes

  • chooseBase also scores each offered base by the bytes it holds anywhere: moved, through a by-digest index of its extents.
  • Consume path, unchanged. It is used when at least MinSame of the bytes stay at the same offsets.
  • New local path. Otherwise, if same plus moved reach MinSame, fromBase reads every still-needed stored chunk the base holds from the base's files where they are:
    • one reader per worker, front to back per file;
    • each chunk is hash-checked before it is written;
    • the base is not claimed or changed;
    • a chunk that cannot be read or fails its check goes to the cache, peers or store as before.
  • Stats local_base, local_bytes. onggi pull --base reports which path was used. The CSI plugin's offer gets the local path as well.
  • Docs: evaluation (GPU section) and the CSI README.

Verification

  • New test, shifted content (a 17,952-byte header in front of the base's bytes, as in TensorRT):
    • no claim;
    • 8.38 MB of 8.4 MB read from the base, 22 KB from the store;
    • output identical, base untouched.
  • The existing rebase, frame, cache and GC tests pass.
  • Lab node, ATOM store, decode B2 restored, then prefill C128 pulled:
prefill C128 (14.0 GB) store read from the base time sha256
plain pull 9.47 GB 0 48.3 s —
with --base B2 (0 % same offset, 79 % elsewhere) 1.93 GB 11.1 GB 40.2 s identical; base untouched

The store here is on the same disk, so the time gain is small. Against a network store, the 80 % fewer store reads are the gain.

Compatibility and limits

  • No format change. Without bases, nothing changes.
  • The base must stay readable during the pull. If it disappears, the remaining chunks come from the other sources.

Related Issue

Closes #58

🤖 Generated with Claude Code

gspark-etri and others added 3 commits October 22, 2026 17:23
…es (#58)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gspark-etri
gspark-etri merged commit fc49e41 into main Oct 22, 2026
3 checks passed
@gspark-etri
gspark-etri deleted the feat/base-local branch October 22, 2026 08:33
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.

Delta apply: copy bytes the base holds at other offsets from the base file (TensorRT-LLM batch change reads 10.8 GB)

1 participant