-
Notifications
You must be signed in to change notification settings - Fork 242
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
Disable build caching when using pocl #738
Conversation
I gave this a quick spin (with the example in #731 (comment)) and didn't notice any negative perfomance impact on the second run, as long as the downstream package (i.e., pocl, nvidia cl) has caching enabled. |
That's a broad set to generalize over. 🙂 If they all have source -> executable caches, then sure, that'd probably be better. Nvidia has a such a cache, I think. Do you know about AMD and Intel? |
pyopencl/__init__.py
Outdated
if _PYOPENCL_NO_CACHE: | ||
build_descr = "uncached source build (cache disabled by user)" | ||
else: | ||
build_descr = "uncached source build (cache disabled for pocl)" |
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.
build_descr = "uncached source build (cache disabled for pocl)" | |
build_descr = "uncached source build (cache disabled because ICD is caching)" |
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.
If I add the characterize function suggested below, should I instead change this to say something like "source build via ICD cache"
?
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.
Sure.
pyopencl/__init__.py
Outdated
no_cache = _PYOPENCL_NO_CACHE | ||
# Turn off caching when using pocl to avoid extra compile from | ||
# get_info(BINARIES). See https://github.com/inducer/pyopencl/issues/731. | ||
from pyopencl.characterize import get_pocl_version |
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.
Maybe add a characterize
function on whether there is an effective source -> executable cache? (Specified to return None
for "unknown", False
for no, and True
for yes.)
4de0f58
to
a72c2b9
Compare
@inducer I'm seeing an intermittent failure in the boxtree CI (here's a failing run and a successful run for the same code). Is this something to be concerned about? |
@@ -374,7 +374,7 @@ def _check_arg_size(function_name, num_cl_args, arg_types, devs): | |||
|
|||
|
|||
if not cl._PYOPENCL_NO_CACHE: | |||
invoker_cache = WriteOncePersistentDict( | |||
invoker_cache: WriteOncePersistentDict = WriteOncePersistentDict( |
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.
Add key and value types WOPD[..., ...]
(also below).
if _PYOPENCL_NO_CACHE: | ||
build_descr = "uncached source build (cache disabled by user)" | ||
else: | ||
build_descr = "source build via ICD cache" |
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.
build_descr = "source build via ICD cache" | |
build_descr = "uncached source build, assumed cached by ICD" |
Kind of, yeah. Can you reproduce it locally? |
Maybe it has something to do with tests being run in parallel? How good is pocl about locking its cache? |
d0aabc5
to
e8e1c3f
Compare
be06e3f
to
5cd5fd9
Compare
5cd5fd9
to
2c53eb5
Compare
It turns out that AMD rocm does not appear to cache built kernels :-( (tested with rocm 5.7.1 and 6.0.3 on tioga). |
This has been merged as part of #749. |
Fixes #731.