redo of [Inductor][Cutlass] verify cutlass has cache_file attribute before moving...resolves cutlass cute exception (#158206)

trying to land https://github.com/pytorch/pytorch/pull/156672

Pull Request resolved: https://github.com/pytorch/pytorch/pull/158206
Approved by: https://github.com/lessw2020, https://github.com/Skylion007
This commit is contained in:
henrylhtsang
2025-07-13 17:58:25 -07:00
committed by PyTorch MergeBot
parent 5633283574
commit f87d117939

View File

@ -45,7 +45,10 @@ def move_cutlass_compiled_cache() -> None:
else:
import cutlass as python_cutlass # type: ignore[import-not-found] # noqa: F401
if not os.path.exists(python_cutlass.CACHE_FILE):
# Check if the CACHE_FILE attribute exists in python_cutlass and if the file exists
if not hasattr(python_cutlass, "CACHE_FILE") or not os.path.exists(
python_cutlass.CACHE_FILE
):
return
try: