Skip to content

docs: add tip for FlashInfer JIT cache install for vLLM model server - #1405

Merged
ananthsub merged 2 commits into
NVIDIA-NeMo:mainfrom
ananthsub:ananthsub/vllm-flashinfer-jit-docs
May 28, 2026
Merged

ananthsub merged 2 commits into
NVIDIA-NeMo:mainfrom
ananthsub:ananthsub/vllm-flashinfer-jit-docs

Conversation

@ananthsub

Copy link
Copy Markdown
Contributor

vLLM's sampler and allreduce paths use FlashInfer, which falls back to runtime JIT compilation via nvcc when no pre-built kernel cache is installed. On a fresh uv pip install vllm --torch-backend=auto setup without a system CUDA toolkit at /usr/local/cuda, this fails with:

  RuntimeError: Could not find nvcc and default cuda_home='/usr/local/cuda' doesn't exist

because PyPI's PyTorch wheels ship the CUDA runtime libs but not the nvcc compiler. Add a Tip block in the vLLM model server page to point users to install flashinfer-cubin and flashinfer-jit-cache so FlashInfer skips JIT entirely.

@copy-pr-bot

copy-pr-bot Bot commented May 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ananthsub
ananthsub marked this pull request as ready for review May 26, 2026 14:10
@ananthsub ananthsub added documentation Improvements to documentation models infra for different models and inference providers; middleware to standardize to OAI responses labels May 26, 2026
```

<Tip>
**Recommended on workstations without a system CUDA toolkit** (i.e. no `/usr/local/cuda`). Install FlashInfer's pre-built kernel packages so vLLM's sampler and allreduce paths do not try to JIT-compile via `nvcc` at startup. Both companion packages enforce strict version equality with the `flashinfer-python` that vLLM pulled in, so pin them to its exact version:

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.

Maybe we could recommend a container?

Also feel this could go to bottom of readme if most people won't need it, but then people might miss it, so im not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i dont want to recommend the RL container right now since it's hard to tell which gym commit/version is currently used in the container. over time i agree we could recommend a container or offer a dockerfile to make it easier to prefetch these dependencies

ananthsub added 2 commits May 28, 2026 15:51
vLLM's sampler and allreduce paths use FlashInfer, which falls back to
runtime JIT compilation via nvcc when no pre-built kernel cache is
installed. On a fresh `uv pip install vllm --torch-backend=auto` setup
without a system CUDA toolkit at `/usr/local/cuda`, this fails with:

  RuntimeError: Could not find nvcc and default cuda_home='/usr/local/cuda' doesn't exist

because PyPI's PyTorch wheels ship the CUDA runtime libs but not the
nvcc compiler. Add a Tip block in the vLLM model server page explaining
the symptom and pointing users at the recommended fix: install
flashinfer-cubin and flashinfer-jit-cache (CUDA-version-matched) so
FlashInfer skips JIT entirely.

Reported in NVBug 6192981.

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
QA reported that the previous unpinned `uv pip install flashinfer-jit-cache --index-url https://flashinfer.ai/whl/cu130` resolves to the newest wheel on the index (e.g., 0.6.11.post3+cu130), which then fails the strict version-equality check in flashinfer/jit/env.py against vLLM 0.21.0's pinned flashinfer-python==0.6.8.post1:

  RuntimeError: flashinfer-jit-cache version (0.6.11.post3+cu130) does not match flashinfer version (0.6.8.post1)

Update the vLLM model server page to:
- discover the installed flashinfer-python version (FI_VER) and torch CUDA tag (TORCH_CU) at install time
- pin both flashinfer-cubin and flashinfer-jit-cache to ${FI_VER}
- include the matching `--index-url https://flashinfer.ai/whl/${TORCH_CU}` for the JIT cache wheel

Add a second example error block so users hitting this exact mismatch can self-diagnose.

Validated end-to-end in /home/ansubramania/dev/Gym-vllm-flashinfer-docs:
- Reproduced the same FI_VER=0.6.8.post1 / TORCH_CU=cu129 vLLM 0.21.0 environment.
- Confirmed the pinned wheels resolve (PyPI 200 for cubin; cu129 index lists the matching jit-cache wheel).
- With pinned companions installed, FLASHINFER_DISABLE_JIT=1, CUDA_HOME unset, and nvcc removed from PATH, flashinfer.sampling.top_k_top_p_sampling_from_logits (the exact API in Phuoc's traceback) returns sampled token ids successfully.
- Negative control: uninstall flashinfer-jit-cache and re-run the same call; it raises MissingJITCacheError, confirming the AOT cache is what fixes the failure.

Reported in NVBug 6192981.

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub
ananthsub force-pushed the ananthsub/vllm-flashinfer-jit-docs branch from a29211c to 89730b5 Compare May 28, 2026 22:51
@copy-pr-bot

copy-pr-bot Bot commented May 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ananthsub
ananthsub merged commit e96ee0b into NVIDIA-NeMo:main May 28, 2026
6 checks passed
@ananthsub
ananthsub deleted the ananthsub/vllm-flashinfer-jit-docs branch May 28, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements to documentation models infra for different models and inference providers; middleware to standardize to OAI responses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants