Skip to content

fix(engine): load prefill triton kernels at startup, not mid-request - #169

Open
jason-fxz wants to merge 2 commits into
mainfrom
fix/prefill-jit-warmup
Open

fix(engine): load prefill triton kernels at startup, not mid-request#169
jason-fxz wants to merge 2 commits into
mainfrom
fix/prefill-jit-warmup

Conversation

@jason-fxz

Copy link
Copy Markdown
Collaborator

Two changes, one goal: no triton compile / cuModuleLoadData on the request path.

  1. fla/l2norm: do_not_specialize=["T"], T was tl.constexpr: a new module per unseen prompt length, forever.
  2. _warmup_prefill runs on every attention backend (was triton-only, so fi/fa had no prefill warmup), over a config-derived ladder covering every in-repo size bucket instead of [80, 128]. New --skip-prefill-warmup; FREETOKEN_WARMUP_MAX_LEN caps the ladder.

Suspected trigger of the sm_89 silent hangs (#123, #72; #31 has a py-spy stack inside cuModuleLoadData): a first-launch module load mid-forward on the scheduler thread.

Tested on H100 (driver 580.95.05, torch 2.11.0+cu130), nvidia/Qwen3.6-35B-A3B-NVFP4, offload + fi: l2norm bitwise equal, same latency; a 11..2560-token sweep loads zero in-repo kernels at request time (main: 4-10 per new size); first-request TTFT on a cold cache 15.1 s -> 0.6 s; warmup adds 4.1 s to startup on a warm cache.

The hang does not reproduce on sm_90. This PR removes the trigger; confirming the fix needs
an sm_89 card.

Refs #123, #72.

@jason-fxz jason-fxz changed the title Fix/prefill jit warmup fix(engine): load prefill triton kernels at startup, not mid-request Aug 25, 2026
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