-
Notifications
You must be signed in to change notification settings - Fork 312
feat: disable hashing for modules and kernels to allow loading from ptx and so #661
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
base: main
Are you sure you want to change the base?
Conversation
from warp.tests.unittest_utils import * | ||
|
||
wp.config.cuda_output = "ptx" | ||
wp.config.kernel_cache_dir = "warp/tests/misc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem I think we have to address is that modifying the kernel_cache_dir
globally won't work well with other modules / libraries that are running in the same Python process.
I think what we really need here is a per-module cache path. e.g.:
wp.set_module_options({"kernel_cache_dir": "warp/tests/misc"})
We could combine this with the per-module disable_hashing
/ kernel_cache_force
flag, so that users would need to do this at the top of their module:
wp.set_module_options({"kernel_cache_force": True, "kernel_cache_dir": "warp/tests/misc"})
Hi @YuyangLee, please sign off the commit as described by the GitHub action: https://github.com/NVIDIA/warp/pull/661/checks?check_run_id=40703124341 This is required before we can accept this. |
@YuyangLee: I think if you can get this pull request to pass the DCO checker, we can handle making additional changes on top of your work to get it into Warp. We can have you review our proposed changes before they go in. As for the changes we want to make, I think we will add some per-module options to specify the kernel output cache and whether hashing is disabled or not rather than relying on an undocumented environment variable. I think it would also be helpful if you could remove the additions to Thanks! |
f0a8ff2
to
1af94da
Compare
…recompiled files without source code Signed-off-by: Yuyang Li <[email protected]>
…review Signed-off-by: Yuyang Li <[email protected]>
1d2cc35
to
3fbf611
Compare
Hi Eric, sorry for the late reply! I have fixed the signoffs, and now the commits are signed by my GPG keys. Also, I have removed the compiled caches and the Thanks a lot! |
Category
Description
This PR tries to implement the feature of disabling hashing on .ptx and .so, so that compiled kernels in PTX and SO libs can be loaded without the source code of the kernel. The user sets the env variable WARP_DISABLE_HASHING_PREFIX to be the prefixes of modules for which the hashing is to be disabled (separated by a comma). For example: setting
WARP_DISABLE_HASHING_PREFIX
to"warp.tests.misc,warp.sim.dummy"
will disable hashing for modules that starts withwarp.sim.misc
andwarp.sim.dummy
.The main modifications are in
warp/context.py
, and an auxiliary unit test is inwarp/tests/misc
. The unit test can be run by the following script and is tested on my personal PC:python -m warp.tests -s autodetect -p '*disable_hashing.py'
We have previously communicated with Mr. Miles about this feature and its downstream applications. We look forward to the Warp team's investigation.
Before your PR is "Ready for review"
stubs.py
,functions.rst
)pre-commit run -a