fix(engine): load prefill triton kernels at startup, not mid-request - #169
fix(engine): load prefill triton kernels at startup, not mid-request#169jason-fxz wants to merge 2 commits into
Conversation
|
Tested on sm_89 (2x RTX 6000 Ada), which is the card this PR most wants a data point from:
Model Setup: 2x RTX 6000 Ada (48 GiB, sm_89, PCIe Gen4, no NVLink), 2x Xeon Gold 6526Y, 503 GiB RAM, CUDA 13.3, torch 2.11+cu130, sgl_kernel 0.4.5; Update 2026-09-05, merged into the deploy branch. Tried on 2 x RTX 6000 Ada (sm_89) serving Qwen3.8-Flash-Next (RadixArk NVFP4) at TP=2, offload backend, fp8 KV pool of 8 x 262,144 tokens, merged onto my deploy branch (main af71ba4 + #385/#386/#389/#392/#354 and ten other open PRs), tests run on the box, then put in production. On this model the QSA sparse backend got no prefill warmup at all before this PR (the call was gated on the triton backend), so the first request of each size bucket compiled on the request path after a Triton-cache-cold start. With this PR: |
…ernels at startup, not mid-request Upstream FlashML-org#169 at a8326af, merged onto deploy/chatdnp for the PR sweep. Conflict in engine/engine.py: both sides add a method at the same place (FlashML-org#231's _emit_moe_stats, FlashML-org#169's _warmup_prefill_lens); kept both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0173pf9k9fSVtwbm3f898HDt
Two changes, one goal: no triton compile / cuModuleLoadData on the request path.
fla/l2norm:do_not_specialize=["T"],Twastl.constexpr: a new module per unseen prompt length, forever._warmup_prefillruns on every attention backend (wastriton-only, sofi/fahad 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_LENcaps 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.