Lazy load TileLang MHC kernels - #30580
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
/rerun-test test/registered/kernels/test_mhc_kernels.py test/registered/models_e2e/test_deepseek_v4* |
|
Results for 🚀 🚀 🚀 |
|
@merrymercy @Ying1123 @Fridge003 @ispobock @HaiShaw @ch-wan @BBuf @Edwardf0t1 — could you please take a look at this PR and merge it? It fixes the FlashInfer allreduce fusion regression introduced by the flashinfer 0.6.14 upgrade (#30875). All CUDA CI checks pass (base-a through base-c, 1-gpu/2-gpu/4-gpu/8-gpu on H100/H200/B200/GB300 all green). The 15 failures are all on non-CUDA platforms (NPU/XPU/AMD) which are unrelated. GitHub shows the PR as mergeable. Additionally, the MHC kernels and DeepSeek V4 e2e tests were explicitly re-run and pass:
I also verified on Note: there's a duplicate PR #30870 targeting the same issue, but this PR (#30580) is a better fix — it makes |
|
Thank you @mmangkad for the fix and @mickqian for merging it! This resolves the FlashInfer allreduce fusion regression from the flashinfer 0.6.14 upgrade (#30875). Confirmed merged on
Closing the related issue as fixed. |
(cherry picked from commit 14bef7c)
[branch adaptation: deepseek_v4.py hunks dropped — this branch imports MHC from sglang.srt.layers.mhc (not sglang.kernels.ops.layernorm.mhc), which is already tilelang-lazy after sgl-project#30580; only cuda_wrapper.py hardening + unit test taken] (cherry picked from commit 04af94d)
Summary
This keeps TileLang out of the DeepSeek V4 import path until we actually need it. Model-registry discovery imports a lot of model files, so it should not also load TileLang's native CUDA stubs just because one unrelated module was discovered.
deepseek_v4_rope.pyonly uses Triton kernels, so it no longer imports TileLang at module load.mhc.pyuses a small lazy proxy, which lets the existing@tilelang.jit(...)definitions stay in place while delaying the real TileLang import until the first MHC TileLang kernel call. The split-k MHC path loads TileLang before usingT.dynamic(...)/T.Tensor[...], and first-load / first-compile paths are guarded with locks.CI States
Latest PR Test (Base): ✅ Run #29010339282
Latest PR Test (Extra): ❌ Run #29010339047