Skip to content

perf(server): ship FlashInfer's prebuilt JIT modules in the sglang-cu130 bundle - #988

Merged
krisztian-gajdar merged 2 commits into
mainfrom
perf/sglang-cu130-prebuilt-flashinfer-kernels
Nov 18, 2026
Merged

krisztian-gajdar merged 2 commits into
mainfrom
perf/sglang-cu130-prebuilt-flashinfer-kernels

Conversation

@krisztian-gajdar

@krisztian-gajdar krisztian-gajdar commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A new sglang-cu130 container compiles FlashInfer's JIT modules with nvcc the first time it uses each one:

On Qwen/Qwen3.8-27B-FP8, these compiles add about 70 s to a load on an RTX PRO 6000 and about 115 s on an H100 (see Evidence).

Change

The sglang-cu130 bundle now depends on flashinfer-jit-cache==0.6.18: FlashInfer's prebuilt JIT modules for CUDA 13.0, matching the bundle's flashinfer-python 0.6.18. When a module is present in the package, FlashInfer loads it instead of compiling.

  • Source pin. FlashInfer publishes the wheel on its own cu130 index, which omits upload timestamps, so uv 0.9.28 excludes it under the global cutoff. exceptions.json pins the exact GitHub release wheel and its SHA256, as it already does for sglang-kernel, sgl-deep-gemm and sgl-deep-ep.
  • Lock. cuda13-sglang-cu130-amd64 is recompiled with its existing cutoffs (--exclude-newer 2026-10-18T00:00:00Z --root-exclude-newer 2026-11-06T20:00:00Z). The only package added is flashinfer-jit-cache 0.6.18+cu130.
  • Image smoke. The CUDA 13 image smoke checks three things, all without a GPU:
    • flashinfer-jit-cache is the 0.6.18+cu130 variant;
    • its version passes FlashInfer's own prefix check against flashinfer-python;
    • the prebuilt sampling module is present.

What FlashInfer 0.6.18 documents and does.

  • The README lists flashinfer-jit-cache as a "Pre-built kernel cache for specific CUDA versions".
  • flashinfer/jit/env.py takes its AOT directory from the installed flashinfer_jit_cache package. It refuses a version that does not match flashinfer-python, so the bundle comment records that this pin moves with SGLang's flashinfer-python pin.
  • flashinfer/jit/core.py loads <aot_dir>/<module>/<module>.so when that file exists, and builds the module otherwise.
  • The wheel's sampling.so carries SASS for sm_80, 89, 90, 100, 103 and 120, and no PTX.

Cost. The wheel is 969 MiB compressed and 1.58 GB unpacked, and the cu130 image grows by that much. SGLang's own image installs this package only when INSTALL_FLASHINFER_JIT_CACHE=1. The chart's optional persistent kernelCache still applies on top of it: it also keeps the Triton, DeepGEMM and CuTe caches, which this package does not cover.

Evidence

Setup.

  • Lab: one GPU, 4 CPUs and 16 GiB per container; Qwen/Qwen3.8-27B-FP8, default profile; sie-server serve -b sglang-cu130 --preload; this repository at a23a94f.
  • Variants:
    • Before: a fresh kernel cache root (SIE_SGLANG_KERNEL_CACHE_ROOT) per run.
    • Prebuilt: the same, with this wheel unpacked onto PYTHONPATH.
    • Kept caches: the kernel cache root a first load wrote, reused by later loads.
    • Shared by every run in the container: HOME, and with it SGLang's own JIT cache. See the correction below.
  • Runs: run 0 is a fresh-cache load on a cold page cache. Three rounds then follow in rotated order, so every compared run reads its weights from a warm page cache.
  • Metrics:
    • load to ready, from server start to the model reporting loaded;
    • the warmup span, from the adapter's Model warmup start/end markers;
    • the first sampled request (temperature 0.7, top-p 0.9, 16 tokens).

Medians of 3:

GPU Variant Load to ready (s) Warmup (s) First sampled request (s) sampling.so compiled
RTX PRO 6000 Before 126.3 45.7 0.38 yes
RTX PRO 6000 Prebuilt (this change) 56.1 0.09 0.38 no
RTX PRO 6000 Kept caches 46.6 0.12 0.39 no
H100 Before 387.5 75.6 0.51 yes
H100 Prebuilt (this change) 272.2 0.19 0.51 no
H100 Kept caches 190.5 0.24 0.34 no
  • Before → prebuilt: 70 s shorter on RTX PRO 6000 and 115 s shorter on H100. That is the warmup's compile plus FlashInfer compiles during engine start.
  • Run to run: runs within each variant differed by at most 5 s, except H100 with kept caches (13 s).
  • Kept caches: these reuse every compiler cache the server namespaces under SIE_SGLANG_KERNEL_CACHE_ROOT (Triton, DeepGEMM, CuTe, TorchInductor, CUDA and SGLang, as well as FlashInfer), so they go 10 s further on RTX PRO 6000 and 82 s further on H100. That is what the optional persistent kernel cache adds on top of this change. Which of those caches accounts for the H100 difference was not measured.
  • Cold first load (run 0): a load with nothing cached, on a cold page cache, took 200.1 s on RTX PRO 6000 and 430.5 s on H100.
  • First sampled request: under 0.6 s in every variant, so moving the compile out of the warmup brings back no first-request stall.

Correction: SGLang's own JIT cache was shared across runs. SGLang 0.5.20 builds its own JIT kernels under SGLANG_JIT_CACHE_DIR. That defaults to ~/.cache/sglang/jit and does not follow SGLANG_CACHE_DIR (python/sglang/kernels/jit/utils/compile/cache.py), so SIE_SGLANG_KERNEL_CACHE_ROOT does not cover it. Every run after run 0 reused the SGLang JIT kernels that run 0 built.

  • Still holds: Before and Prebuilt both had those kernels, so the difference between them (70 s and 115 s) compares like with like. That difference is what this change removes.
  • Does not hold: the Before and Prebuilt rows are not the load of a new container, which also builds SGLang's JIT kernels.

A follow-up run gave each run a fresh HOME, with the same model, server and commit, 4 CPUs, and this wheel installed in every run:

GPU Kept between runs Load to ready (s) Runs
RTX PRO 6000 nothing 136.3 (median) 3
RTX PRO 6000 only ~/.cache/sglang 59.8 (median) 2
RTX PRO 6000 everything 49.8 (median) 2
H100 nothing 256.2 and 289.8 1 each, in two containers

On an RTX PRO 6000, a new container with this change therefore loads in about 136 s. SGLang's own JIT kernels account for about 77 s of that, and this change does not cover them. Bringing SGLANG_JIT_CACHE_DIR under the kernel cache root is left to a separate change.

Checks.

  • python tools/ci/bundle_lock.py check passes.
  • tools/ci/tests/test_bundle_lock.py and packages/sie_server/tests/core/test_bundle_lock.py pass (58).
  • packages/sie_server/tests/core/test_bundle_image_resolution.py passes (19), run with SIE_RUN_IMAGE_RESOLUTION=1 and uv 0.9.28.
  • tools/ci/tests/test_cuda13_image_smoke.py passes (11).
  • mise run lint passes.

Not covered. The lab loaded the wheel from PYTHONPATH, not from an image built from this lock. The cuda13-sglang-cu130 image workflow builds that image.

Summary by CodeRabbit

  • Bug Fixes
    • Updated the CUDA 13 SGLang bundle to include FlashInfer JIT cache version 0.6.18, matching its FlashInfer version.
  • Chores
    • Expanded CUDA 13 image checks to verify the versions of key SGLang packages, confirm the JIT cache version matches FlashInfer, and ensure its prebuilt sampling component is present.

…130 bundle

A new sglang-cu130 container compiled FlashInfer's JIT modules with nvcc the first time each was used: the sampling module during the sampled warmup, and further modules while the engine starts. flashinfer-jit-cache 0.6.18+cu130 carries those modules prebuilt for sm_80 through sm_120, and FlashInfer loads them instead of compiling. The wheel comes from FlashInfer's GitHub release through a source pin, like the other cu130 wheels whose index omits upload timestamps.
@krisztian-gajdar
krisztian-gajdar requested a review from a team as a code owner November 18, 2026 10:29
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CUDA 13 SGLang bundle adds flashinfer-jit-cache version 0.6.18. Its lock and source pin are updated, and image smoke checks verify package versions and the prebuilt sampling module.

Changes: CUDA 13 SGLang JIT-cache dependency

Layer / File(s) Summary
Declare and lock the JIT-cache dependency
packages/sie_server/bundles/sglang-cu130.yaml, packages/sie_server/bundle-locks/cuda13-sglang-cu130-amd64/pylock.toml, packages/sie_server/bundle-locks/exceptions.json, packages/sie_server/bundle-locks/cuda13-sglang-cu130-amd64/manifest.json
The bundle pins flashinfer-jit-cache to 0.6.18. The lock and source exception record the CUDA 13 wheel and hash. The manifest digests are updated.
Validate the image package and module
tools/ci/cuda13_image_smoke.py, tools/ci/tests/test_cuda13_image_smoke.py
The image checks validate package versions, JIT-cache version alignment with flashinfer-python, and the presence of sampling/sampling.so. Tests cover the checks.

Possibly related PRs

  • superlinked/sie#855: Regenerates bundle locks and updates the same lock-binding input digest fields.
  • superlinked/sie#886: Renames the manifest input digest and regenerates manifests under the lock-binding contract.

Suggested reviewers: dragosboca, huronat

Merge Risk: Minimal · up to 10e2d

This adds a prebuilt FlashInfer JIT-cache wheel to the CUDA 13 SGLang bundle. It is expected to cut model load time, at the cost of a larger image. The pins, lock and smoke checks are aligned, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: shipping FlashInfer's prebuilt JIT modules through the sglang-cu130 bundle. The changeset adds flashinfer-jit-cache 0.6.18+cu130 to the bundle declaration, the lock…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the primary change: shipping FlashInfer's prebuilt JIT modules through the sglang-cu130 bundle. The changeset adds flashinfer-jit-cache 0.6.18+cu130 to the bundle declaration, the lockfile, exceptions.json, and the CUDA 13 image smoke checks, which match this aim. The 'perf(server)' prefix is a conventional commit type and scope, and the title is a single concise sentence.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 6f2360e2-edc6-46be-ae47-5d11b28a2a98
Commits

Reviewing files that changed from the base of the PR and between 254c73f and 10e2d96.

Files selected for processing: 1

  • tools/ci/tests/test_cuda13_image_smoke.py
Files skipped from review as they are similar to previous changes: 1

  • tools/ci/tests/test_cuda13_image_smoke.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 18, 2026
@krisztian-gajdar
krisztian-gajdar added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 359516e Nov 18, 2026
46 of 47 checks passed
@krisztian-gajdar
krisztian-gajdar deleted the perf/sglang-cu130-prebuilt-flashinfer-kernels branch November 18, 2026 22:41
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