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

[QST] Cutlass Python not showing custom mofifications #2057

Open
IzanCatalan opened this issue Jan 24, 2025 · 5 comments
Open

[QST] Cutlass Python not showing custom mofifications #2057

IzanCatalan opened this issue Jan 24, 2025 · 5 comments

Comments

@IzanCatalan
Copy link

IzanCatalan commented Jan 24, 2025

What is your question?
Hi, I would like to know how to import Cutlass from source for Python. I have read the guidelines in readme and installed with pip install -e . from /cutlass main folder. But if I modify the source code from any of the other folders, for instance, /inlcude/cutlass/conv/kiernel and compile it ( via make make -j$(nproc) in /cutlass/build folder) and after that, I uninstalled cutlass (pip uninstall), and I installed it again, the modifications didn't appear. If I use the examples (like example 16 ) with C++ and execute them from inside/cutlass/build, it works.

How can I also make the modifications in the source code appear in Python?

@hwu36
Copy link
Collaborator

hwu36 commented Feb 6, 2025

@jackkosaian

@jackkosaian
Copy link
Contributor

What do you mean when you say that "the modifications didn't appear"? How are you checking for the presence of your modifications?

@IzanCatalan
Copy link
Author

@jackkosaian I use printf functions throughout all the code in both files https://github.com/NVIDIA/cutlass/blob/24f991e87930e1159f1f5a47e329d43bcfbd76b9/include/cutlass/conv/kernel/implicit_gemm_convolution.h (mainly in operator() function) and in https://github.com/NVIDIA/cutlass/blob/24f991e87930e1159f1f5a47e329d43bcfbd76b9/include/cutlass/conv/device/implicit_gemm_convolution.h (mainly in run() function).

When I modify, add, or eliminate these prints, as I commented, executing example 16 the output is correct. Still, when I compile and install Cutlass for Python, the output is the one when I first added or modified the prints; any further later modification no longer appears.

@jackkosaian
Copy link
Contributor

The CUTLASS Python interface caches compiled code in a local file called compiled_cache.db. On subsequent runs, you're likely getting a cache hit, which results in not recompiling the kernel.

Can you please try deleting compiled_cache.db before trying the Python script again?

@IzanCatalan
Copy link
Author

Yes, @jackkosaian, it was exactly what you said. I removed compiled_cache.db, uninstalled the package and installed it again, and it worked. I was not aware of this. Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants