Skip to content

[CI Bugfix] Pre-download missing FlashInfer headers in Docker build - #38391

Merged
vllm-bot merged 2 commits into
mainfrom
fix/flashinfer-bmm-headers-dockerfile
Mar 28, 2026
Merged

vllm-bot merged 2 commits into
mainfrom
fix/flashinfer-bmm-headers-dockerfile

Conversation

@mgoin

@mgoin mgoin commented Mar 27, 2026

Copy link
Copy Markdown
Member

Summary

  • NOTE: This is a temporary fix to unblock our CI - the proper fix should be upstream in flashinfer, hopefully fix: avoid re-downloading BMM export headers when flashinfer-cubin is installed flashinfer-ai/flashinfer#2903
  • Pre-download FlashInfer TRTLLM BMM headers at Docker build time to fix air-gapped/offline runtime failures
  • The flashinfer-cubin package ships headers at the artifact hash path (cubins/b55211623.../include/trtllmGen_bmm_export/), but runtime code (download_trtllm_headers) looks for them at cubins/flashinfer/trtllm/batched_gemm/trtllmGen_bmm_export/ — a path mismatch that causes network downloads on every startup
  • Without this fix, startup takes ~2min extra for serial header downloads, and completely fails in air-gapped environments or when NVIDIA's artifactory returns 403 (as seen with SfLayoutDecl.h)

Root Cause

flashinfer-cubin==0.6.6 includes all 17 BMM headers + checksums.txt, but only at the artifact hash path. The runtime download_trtllm_headers() function (called from flashinfer/jit/moe_utils.py and flashinfer/jit/fused_moe.py) writes to and reads from a different path under flashinfer/trtllm/batched_gemm/. Since get_file()load_cubin() doesn't find the headers at the expected path, it always falls through to downloading from edge.urm.nvidia.com.

Fix

Call download_trtllm_headers() at Docker build time (when internet is available). This populates the correct runtime path so load_cubin() finds everything locally — zero network access needed at serving time.

Verified locally:

$ FLASHINFER_CUBINS_REPOSITORY="http://localhost:1/" python -c "
from flashinfer.jit import env as jit_env
from flashinfer.jit.cubin_loader import download_trtllm_headers, get_cubin
from flashinfer.artifacts import ArtifactPath, CheckSumHash
download_trtllm_headers('bmm',
    jit_env.FLASHINFER_CUBIN_DIR / 'flashinfer' / 'trtllm' / 'batched_gemm' / 'trtllmGen_bmm_export',
    f'{ArtifactPath.TRTLLM_GEN_BMM}/include/trtllmGen_bmm_export',
    ArtifactPath.TRTLLM_GEN_BMM,
    get_cubin(f'{ArtifactPath.TRTLLM_GEN_BMM}/checksums.txt', CheckSumHash.TRTLLM_GEN_BMM))
print('All BMM headers loaded from local cache - no network needed!')
"
All BMM headers loaded from local cache - no network needed!

Fixes #38110

Test plan

  • Docker image builds successfully with this change
  • gpt-oss MXFP4 MoE models start without header download attempts
  • Air-gapped runtime no longer fails with ConnectTimeoutError on edge.urm.nvidia.com

🤖 Generated with Claude Code

The flashinfer-cubin package ships BMM headers at the artifact hash
path (cubins/b55211623.../include/trtllmGen_bmm_export/), but the
runtime code looks for them at a different path
(cubins/flashinfer/trtllm/batched_gemm/trtllmGen_bmm_export/). This
mismatch causes runtime downloads from edge.urm.nvidia.com on every
startup, which fails in air-gapped environments and adds ~2min of
serial header fetching even with internet access.

Fix by calling download_trtllm_headers() at Docker build time, which
populates the correct runtime path so no network access is needed at
serving time.

Fixes #38110

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: mgoin <mgoin64@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@mergify mergify Bot added the ci/build label Mar 27, 2026
@mgoin mgoin added ready ONLY add when PR is ready to merge/full CI is needed ci-failure Issue about an unexpected test failure in CI labels Mar 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Dockerfile to pre-download FlashInfer TRTLLM BMM headers, ensuring that MoE JIT compilation works in air-gapped environments without requiring internet access at runtime. The review feedback suggests improving the readability and maintainability of the inline Python script by using a heredoc instead of a quoted string with backslashes and semicolons.

Comment thread docker/Dockerfile Outdated
@mgoin mgoin changed the title Pre-download FlashInfer TRTLLM BMM headers in Docker build [CI Bugfix] Pre-download missing FlashInfer headers in Docker build Mar 27, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: mgoin <mgoin64@gmail.com>

@yewentao256 yewentao256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

khluu added a commit that referenced this pull request Mar 27, 2026
…cker build

Signed-off-by: khluu <khluu000@gmail.com>
#38391
khluu pushed a commit that referenced this pull request Mar 27, 2026
…cker build

Signed-off-by: khluu <khluu000@gmail.com>
#38391
@mgoin

mgoin commented Mar 28, 2026

Copy link
Copy Markdown
Member Author

This fixed all the b200 failures I saw in last night's build, so merging

@vllm-bot
vllm-bot merged commit 2bf5b70 into main Mar 28, 2026
134 of 143 checks passed
@vllm-bot
vllm-bot deleted the fix/flashinfer-bmm-headers-dockerfile branch March 28, 2026 13:09
@mgoin mgoin added this to the v0.18.0 cherry picks milestone Mar 30, 2026
neweyes pushed a commit to neweyes/vllm that referenced this pull request Mar 31, 2026
…llm-project#38391)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: neweyes <328719365@qq.com>
puririshi98 pushed a commit to puririshi98/vllm that referenced this pull request Apr 7, 2026
…llm-project#38391)

Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: Rishi Puri <riship@nvidia.com>
mtparet pushed a commit to blackfuel-ai/vllm that referenced this pull request Apr 9, 2026
mystous pushed a commit to mystous/vllm_hybrid that referenced this pull request May 10, 2026
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request May 15, 2026
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci/build ci-failure Issue about an unexpected test failure in CI ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: flashinfer-cubin does not include all cubins/headers

3 participants