Skip to content

docs(examples): VolumeCache warm-cache example + transport benchmarks - #48

Open
deanq wants to merge 9 commits into
mainfrom
deanq/sls-367-volume-cache-example
Open

docs(examples): VolumeCache warm-cache example + transport benchmarks#48
deanq wants to merge 9 commits into
mainfrom
deanq/sls-367-volume-cache-example

Conversation

@deanq

@deanq deanq commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Adds a 05_data_workflows/05_volume_warm_cache/ example for runpod.serverless.VolumeCache plus a benchmark suite, including the quadrant transport benchmark that motivated the adaptive-transport work in runpod-python (#538, merged).

Contents:

  • Example (gpu_worker.py + README): a Flash @Endpoint that warm-caches its model via VolumeCache (HF cache on local disk, mirrored to the network volume) instead of pointing HF_HOME at the mount.
  • Benchmark (benchmark/): direct-on-volume vs VolumeCache cold-start A/B (serverless), a rigorous/ pod-based harness with page-cache eviction and breakeven analysis, and a quadrant/ serverless benchmark.
  • Quadrant benchmark (benchmark/quadrant/): a CPU serverless worker that sweeps file-shape quadrants (few/many × small/large + a mixed HF-like tree) across serial/parallel/tar transport in both mirror and hydrate directions, with cold page cache and a byte-for-byte correctness gate. Measured results are tabulated in benchmark/quadrant/README.md.

Findings (why adaptive transport)

Mirror (local → volume), mean seconds:

tree serial parallel tar
40,000 × 16 KiB 428.7s 62.0s 5.9s
3,000 × 1 MiB 31.5s 4.0s 9.4s
8 × 256 MiB 2.67s 0.59s 5.32s

Mean file size decides the winner: many-small-file trees favor tar (metadata collapse; 72× over serial), large files favor parallel (tar's single stream is dead weight). This is the empirical basis for the 256 KiB size-bucketed transport in the runpod-python VolumeCache follow-up.

Dependency status

VolumeCache landed in runpod-python via #538 (merged) and ships in runpod 1.12.0. This PR pins runpod>=1.12.0; the earlier pin pointed at #531's branch, which was closed as superseded and carries the pre-adaptive-transport implementation.

Merge order: hold this until runpod 1.12.0 publishes (release-please runpod-python#556).

One gate remains before the example runs end-to-end: the deployed flash-worker image must be built against runpod>=1.12.0. The model load happens inside the remote GPU worker, so it is that image's runpod that must have VolumeCache — it cannot be added at runtime via dependencies, because the worker's runpod is imported before the handler runs. Until then the example is labeled illustrative in its README, and the benchmark's direct arm runs standalone via --skip-volumecache.

Linear: SLS-367

Test plan

  • Examples are import-and-run demos; make quality-check (ruff format + lint) passes on the added files.
  • Benchmarks are run manually against a Runpod endpoint / pod with a mounted network volume (each subdir README documents how). The quadrant benchmark was executed on real Runpod serverless and its numbers are recorded in benchmark/quadrant/README.md (the raw results.json is a run artifact and is gitignored, not committed); the rigorous harness was run on a GPU pod.
  • gpu_worker.py itself has not been run end-to-end — it is blocked on the flash-worker image gate above.

@capy-ai

capy-ai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@deanq deanq changed the title docs(examples): VolumeCache warm-cache example + transport benchmarks docs(examples): SLS-367 VolumeCache warm-cache example + transport benchmarks Jul 11, 2026
@deanq deanq changed the title docs(examples): SLS-367 VolumeCache warm-cache example + transport benchmarks docs(examples): VolumeCache warm-cache example + transport benchmarks Jul 11, 2026
deanq added 6 commits July 24, 2026 12:58
…tive transport

Serverless CPU-endpoint benchmark sweeping file-shape quadrants
(few/many x small/large + mixed HF) across serial/parallel/tar transport
in both mirror and hydrate directions. Provides the empirical basis for
the 256 KiB size-bucketed adaptive transport. Includes recorded results.
@deanq
deanq force-pushed the deanq/sls-367-volume-cache-example branch from b058f01 to 3692334 Compare July 24, 2026 19:58
deanq added 3 commits July 27, 2026 00:00
Repo has no committed uv.lock, so CI's uv sync floats ruff>=0.8.0 to
0.16.0, which formats Python inside Markdown code blocks by default and
flags pre-existing repo-wide files. Cap at <0.16 (resolves 0.15.x) to
restore the passing behavior CI had before the float.
PR #531 was closed as superseded by #538, which is now merged and ships
VolumeCache in runpod 1.12.0. The example pinned runpod to #531's branch,
which still resolves but carries the pre-adaptive-transport implementation.

- requirements.txt and both rigorous/ install commands now use runpod>=1.12.0
  instead of the superseded git branch pin.
- Status notes across the example, benchmark, quadrant and rigorous READMEs
  now cite #538 and name the one remaining gate: a flash-worker image built
  against runpod>=1.12.0, since the model load runs in the remote worker.
results.json is a run artifact written by benchmark.py, not source, so it
should never have been committed. Removed and added to benchmark/.gitignore
so a re-run does not re-add it.

The measured numbers were already tabulated in quadrant/README.md, which
stays as the committed record of the 2026-07-09 run. Reworded the two README
pointers and the benchmark.py docstring that referred to the raw file; the
hydrate reference now points at the summary matrix, which carries the hydrate
winners the raw file was being cited for.
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