PytatoPyOpenCLArrayContext: use SVM allocator if available, limit arg size for GPUs#189
Merged
PytatoPyOpenCLArrayContext: use SVM allocator if available, limit arg size for GPUs#189
Conversation
156e369 to
ba7c205
Compare
inducer
reviewed
Aug 31, 2022
Owner
inducer
left a comment
There was a problem hiding this comment.
This looks good generally. Two style nits below.
Two questions:
- Does it work?
- How come it's marked as draft?
arraycontext/impl/pytato/compile.py
Outdated
|
|
||
| with ProcessLogger(logger, f"generate_loopy for '{prg_id}'"): | ||
| import pyopencl as cl | ||
| dev = self.actx.context.devices[0] |
Owner
There was a problem hiding this comment.
Safer to get it from the queue, which only has one device.
inducer
reviewed
Aug 31, 2022
arraycontext/impl/pytato/compile.py
Outdated
| and cl.characterize.has_coarse_grain_buffer_svm(dev)): | ||
| limit = dev.max_parameter_size | ||
| # Leave some extra space since our sizes are estimates | ||
| target = lp.PyOpenCLTarget(limit_arg_size_nbytes=limit//2) |
Owner
There was a problem hiding this comment.
Hmm, upon second thought: We can only pass this if we're sure that the memory allocated is actually SVM. So this has to get involved with memory pool creation.
Collaborator
Author
There was a problem hiding this comment.
Should we do this here or as part of inducer/loopy#642 ?
Collaborator
Author
Collaborator
Author
As far as I can tell, yes.
This still needs the other PRs to be merged first I think. |
40c3821 to
6e912a9
Compare
Collaborator
Author
|
This is ready for another review @inducer |
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs:
LoopyPyOpenCLTarget: pass through loopy.PyOpenCLTarget pytato#359(maybe not needed)PyOpenCL target: Overflow large argument counts into SVM struct loopy#642