[CI] Keep the torch compilation cache instead of wiping it on install (#34231)
This commit is contained in:
@@ -229,20 +229,10 @@ install_gdrcopy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clean_site_packages() {
|
clean_site_packages() {
|
||||||
# Clear torch compilation cache from every location it can be in; sglang
|
# The torch compilation cache is deliberately NOT wiped here: entries are
|
||||||
# is not installed yet, so it cannot be asked which one is in use.
|
# content-hash addressed so stale ones are never reused, and hosts packing
|
||||||
python3 -c '
|
# several runners share one cache mount - a wipe unlinks files a concurrent
|
||||||
import getpass, os, shutil, tempfile
|
# job is compiling against.
|
||||||
|
|
||||||
sglang_cache_dir = os.environ.get("SGLANG_CACHE_DIR") or "~/.cache/sglang"
|
|
||||||
for cache_dir in (
|
|
||||||
os.environ.get("TORCHINDUCTOR_CACHE_DIR"),
|
|
||||||
os.path.join(tempfile.gettempdir(), "torchinductor_" + getpass.getuser()),
|
|
||||||
os.path.join(os.path.expanduser(sglang_cache_dir), "inductor"),
|
|
||||||
):
|
|
||||||
if cache_dir:
|
|
||||||
shutil.rmtree(cache_dir, ignore_errors=True)
|
|
||||||
'
|
|
||||||
|
|
||||||
# Remove broken dist-info directories (missing METADATA per PEP 376)
|
# Remove broken dist-info directories (missing METADATA per PEP 376)
|
||||||
SITE_PACKAGES=$(python3 -c "import site; print(site.getsitepackages()[0])")
|
SITE_PACKAGES=$(python3 -c "import site; print(site.getsitepackages()[0])")
|
||||||
|
|||||||
Reference in New Issue
Block a user