Skip to content

[Carry] Dockerfile: cache mount for flashinfer cubin downloads - #18

Draft
terafin wants to merge 1 commit into
intarweb-devfrom
feat/dockerfile-flashinfer-cubin-cache
Draft

[Carry] Dockerfile: cache mount for flashinfer cubin downloads#18
terafin wants to merge 1 commit into
intarweb-devfrom
feat/dockerfile-flashinfer-cubin-cache

Conversation

@terafin

@terafin terafin commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Internal carry, lands via FORK_CARRIED_COMMITS. Draft for visibility only — not intended to merge.

What

Add a BuildKit cache mount to the flashinfer download-cubin step in vllm-base:

RUN --mount=type=cache,target=/root/.cache/flashinfer,sharing=locked \
    flashinfer show-config && flashinfer download-cubin

Why fork-only

We control build cadence on our builder; --mount=type=cache requires BuildKit + a persistent builder. Upstream may build in environments where this assumption doesn't hold.

Why sharing=locked

Concurrent cubin downloads to the same target can corrupt partial files (race on the same on-disk paths). sharing=locked serializes concurrent builders touching this cache target.

Risk

  • First cold build: no change (~9m, cache empty)
  • Subsequent builds on the same builder: skip the download (~7m savings)
  • Dockerfile-only diff
  • Carry-drift guard: not touching .cu/.cpp/.h — safe

The vllm-base stage's `flashinfer download-cubin` step takes ~9m of
network-bound cubin fetch with no cache, on every build. Add a
BuildKit cache mount so subsequent builds reuse the downloaded cubins:

    RUN --mount=type=cache,target=/root/.cache/flashinfer,sharing=locked \
        flashinfer show-config && flashinfer download-cubin

`sharing=locked` because cubin downloads are not safe to do
concurrently — concurrent downloaders racing the same cache target
can corrupt partial files.

First cold build still pays the full 9m. Subsequent builds (rebuilds
on the same builder, with the cache mount preserved) skip the
download — typical savings ~7m wall-time off vllm-base.

Intarweb-only carry (fork-only — not filed upstream). Dockerfile-only
diff; carry-drift guard safe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intarweb-sync-bot
intarweb-sync-bot Bot force-pushed the intarweb-dev branch 29 times, most recently from cbeb0e5 to 5bcea71 Compare June 14, 2026 10:09
@intarweb-sync-bot
intarweb-sync-bot Bot force-pushed the intarweb-dev branch 17 times, most recently from f02f651 to 1f3d93f Compare June 19, 2026 23:09
@intarweb-sync-bot
intarweb-sync-bot Bot force-pushed the intarweb-dev branch 13 times, most recently from 5eadc10 to 03b0a58 Compare June 28, 2026 09:26
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