MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / set_volume_caches

Function set_volume_caches

src/fused_mm_sampling/modal_lib/utils.py:122–133  ·  view source on GitHub ↗

Point cache env vars to the Modal volume and enable Triton autotune logging. XDG_CACHE_HOME: used by flashinfer, torch.compile, etc. TRITON_CACHE_DIR: used by Triton for compiled kernels and autotune results. Triton ignores XDG_CACHE_HOME and reads TRITON_CACHE_DIR (or TRITON_HOME) inst

()

Source from the content-addressed store, hash-verified

120
121
122def set_volume_caches():
123 """Point cache env vars to the Modal volume and enable Triton autotune logging.
124
125 XDG_CACHE_HOME: used by flashinfer, torch.compile, etc.
126 TRITON_CACHE_DIR: used by Triton for compiled kernels and autotune results.
127 Triton ignores XDG_CACHE_HOME and reads TRITON_CACHE_DIR (or TRITON_HOME) instead.
128 TRITON_PRINT_AUTOTUNING: surfaces autotune progress so silent waits
129 (cold cache, hangs) are debuggable from the run log.
130 """
131 os.environ["XDG_CACHE_HOME"] = f"{volume_path}/cache"
132 os.environ["TRITON_CACHE_DIR"] = f"{volume_path}/cache/triton"
133 os.environ["TRITON_PRINT_AUTOTUNING"] = "1"
134
135
136def add_library_code(image: modal.Image) -> modal.Image:

Callers 7

functionFunction · 0.85
mainFunction · 0.85
ncu_runFunction · 0.85
nsys_profileFunction · 0.85
functionFunction · 0.85
modal_pytest_distributedFunction · 0.85
speed_testFunction · 0.85

Calls

no outgoing calls

Tested by 3

mainFunction · 0.68
modal_pytest_distributedFunction · 0.68
speed_testFunction · 0.68