Skip to content

GPU: pipeline library saved in segments (only what is new); pre-build on cores - 2 - #5

Open
mercuryVM wants to merge 1 commit into
mainfrom
impl/library-save
Open

mercuryVM wants to merge 1 commit into
mainfrom
impl/library-save

Conversation

@mercuryVM

Copy link
Copy Markdown
Owner

Why

The pipeline library was one blob serialised whole at every save. During the pre-build (victory translate --cache --pipelines), it was rewritten every ~70 s: 23 saves in 27 minutes, growing to 336-387 MB each (~7 GB to a USB SSD), while every logical core compiled pipelines. The machine froze.

What

  • Segments. host-pipelines-NNNNN.bin (plus the older single host-pipelines.bin) are each loaded as they are. A run stores into a library of its own, saved as the next segment, then stores into a fresh one, so every pipeline is written once. Lookups try each segment. A segment the host refuses (driver change) is deleted. The pre-build's list holds for the segments' hashes.
  • Throttle. A save of new pipelines waits until they reach 10% of the bytes saved and a minute has passed, or ten minutes, or the end of the run. The early and pre-built lists (small) go with any save.
  • Pre-build jobs. victory translate and the pre-build default to every logical core but two (--jobs still overrides).

Tests

  • Segment files are found in order.
  • A stored pipeline is found in the segment saved from it, and not in the fresh library after (RTX 5070).
  • The save rule.
  • A rejected blob.
  • cargo test -p victory-gpu --lib -- pipeline::library: 7 passed. Clippy is clean, and the diag build is OK.

Base: fork main d8ebe28.

🤖 Generated with Claude Code

…ild on cores - 2

The library was one blob serialised whole at every save: the pre-build
(`translate --cache --pipelines`) rewrote it every ~70 s, 23 times in 27
minutes, up to 387 MB each (~7 GB to a USB disk) while every logical core
compiled pipelines, and the machine froze.

- Segments: `host-pipelines-NNNNN.bin` (and the older single file) are
  each loaded as they are; a run stores into a library of its own, saved
  as the next segment, then into a fresh one. Every pipeline is written
  once. Lookups try each segment. A segment the host refuses (another
  driver) is deleted. The pre-build's list holds for the segments' hashes.
- A save of new pipelines waits for them to reach 10% of the bytes saved
  and a minute, or ten minutes, or the run's end; the early and pre-built
  lists (small) go with any save.
- `victory translate` (and the pre-build) defaults to every logical core
  but two.

Tests: segment files in order; a stored pipeline is in the segment saved
from it and not in the fresh library after; the save rule; a rejected blob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant