From 0be8a0af0ef2d1c740dc4d084f368e75ef55a2cf Mon Sep 17 00:00:00 2001 From: Shuwen Wang <47200617+alphabetc1@users.noreply.github.com> Date: Fri, 18 Sep 2026 15:06:35 +0800 Subject: [PATCH] [DSV4] fix: keep the TileLang JIT cache under SGLANG_CACHE_DIR (#39364) --- python/sglang/srt/entrypoints/engine.py | 1 + python/sglang/srt/environ.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/python/sglang/srt/entrypoints/engine.py b/python/sglang/srt/entrypoints/engine.py index 3b4eb790b..fecbc573f 100644 --- a/python/sglang/srt/entrypoints/engine.py +++ b/python/sglang/srt/entrypoints/engine.py @@ -1784,6 +1784,7 @@ def _log_legacy_kernel_cache_dirs(): os.path.expanduser("~/.triton"), os.path.expanduser("~/.cache/flashinfer"), os.path.expanduser("~/.cache/deep_gemm"), + os.path.expanduser("~/.tilelang/cache"), ) if os.path.isdir(d) ] diff --git a/python/sglang/srt/environ.py b/python/sglang/srt/environ.py index c71c22d50..a84f362fa 100644 --- a/python/sglang/srt/environ.py +++ b/python/sglang/srt/environ.py @@ -1948,6 +1948,10 @@ def third_party_cache_defaults() -> Dict[str, str]: "TRITON_CACHE_DIR": os.path.join(base, "triton"), "TORCHINDUCTOR_CACHE_DIR": os.path.join(base, "inductor"), "CUDA_CACHE_PATH": os.path.join(base, "nv"), + # TileLang compiles the DeepSeek-V4 MHC prenorm kernels; left at its own + # default the burst is invisible to anyone warming, mounting or baking + # SGLANG_CACHE_DIR, and gets paid again on every cold container. + "TILELANG_CACHE_DIR": os.path.join(base, "tilelang"), # FlashInfer appends ".cache/flashinfer" to this base itself, so this # is the base dir rather than the final cache dir. "FLASHINFER_WORKSPACE_BASE": base,