pytorch / torchdynamo

A Python-level JIT compiler designed to make unmodified PyTorch programs faster.
BSD 3-Clause "New" or "Revised" License
1.01k stars 123 forks source link

TMPDIR ignored #2004

Closed timlacroix closed 1 year ago

timlacroix commented 1 year ago

🐛 Describe the bug

Using torch.compile in an environment with no /tmp folder available is difficult. I've had to monkey patch triton and figure out two relevant env variables to set : TORCHINDUCTOR_CACHE_DIR and TRITON_CACHE_DIR

For reference, the problem in triton was in lib/driver/llvm.cc::ptx_to_cubin which uses std::tmpnam.

expected behaviour: default to a temporary directory with a root similar to the return value of https://en.cppreference.com/w/cpp/filesystem/temp_directory_path

Error logs

No response

Minified repro

No response