Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/sglang/kernels/jit/utils/compile/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ def _normalize_text(text: str) -> str:


def cache_root() -> pathlib.Path:
configured = envs.SGLANG_JIT_CACHE_DIR.get() or "~/.cache/sglang/jit"
configured = envs.SGLANG_JIT_CACHE_DIR.get() or os.path.join(
os.path.expanduser(envs.SGLANG_CACHE_DIR.get()), "jit"
)
return pathlib.Path(configured).expanduser()


Expand Down
5 changes: 4 additions & 1 deletion python/sglang/srt/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,10 @@ class Envs:
# that select a kernel in production live with their own feature instead.
# JIT kernel build cache. None = unset, resolving to ~/.cache/sglang/jit;
# point it at a persistent mount to share builds across CI jobs.
SGLANG_JIT_CACHE_DIR = EnvStr(None)
# JIT kernel build cache. Defaults to $SGLANG_CACHE_DIR/jit so it stays
# colocated with the other caches (triton, inductor, deep_gemm, cute_aot).
# Set to an explicit path to override.
SGLANG_JIT_CACHE_DIR = EnvStr(lambda: _default_cache_subdir("jit"))
# Log, at INFO, which dependency changed whenever a module is rebuilt.
SGLANG_JIT_CACHE_DEBUG = EnvBool(False)
# How many builds to keep per module variant. None = unset = keep all, which
Expand Down
Loading