Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Automatically clear the JIT cache if the cache fails to load #90

Open
woct0rdho opened this issue Mar 14, 2025 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@woct0rdho
Copy link
Owner

woct0rdho commented Mar 14, 2025

Please help if you have some idea on how to do this.

A common cause of ImportError: DLL load failed while importing cuda_utils is that the user tries to load a cache compiled with a different version of Python/Triton/C compiler/CUDA. Although in the latest version of triton-windows I'm trying keep the ABI compatibility, I still need detailed error reports from more people to understand this issue.

In the meanwhile, we can just clear the caches and redo the compilation when the error happens. Both Triton's cache and TorchInductor's cache need to be cleared:

C:\Users\<your username>\.triton\cache\
C:\Users\<your username>\AppData\Local\Temp\torchinductor_<your username>\

The most naive idea is to just delete these two folders and redo the compilation when the error is caught here. However, it looks strange if Triton manages TorchInductor's cache (TorchInductor depends on Triton, not vice-versa), and I haven't checked how TorchInductor calls Triton's compilation API and manages the cache, so we need a good idea on how properly do this.

The re-compilation should be done only once. If the cache still fails to load, then it's a problem somewhere else.

For app developers like ComfyUI: You may also consider clearing the caches when the app starts.

@woct0rdho woct0rdho added the help wanted Extra attention is needed label Mar 14, 2025
@woct0rdho woct0rdho changed the title Feature: Automatically clear the cache if the cache fails to load Feature: Automatically clear the JIT cache if the cache fails to load Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant