-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use cuda.bindings
and cuda.core
for Linker
#133
base: main
Are you sure you want to change the base?
Conversation
Thanks, @brandon-b-miller. Remember our goal is to drop every Linker subclasses inside Numba, in favor of |
cuda.bindings
and cuda.core
for nvjitlink
cuda.bindings
and cuda.core
for Linker
numba_cuda/numba/cuda/codegen.py
Outdated
|
||
# Load | ||
cufunc = module.get_function(self._entry_name) | ||
#cufunc = module.get_function(self._entry_name) | ||
cufunc = cubin.get_kernel(self._entry_name) |
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.
Since we switched to context independent loading API, the CUDADispatcher.bind
method should probably be renamed since it no longer binds context via calling the get_cufunc
function.
/ok to test |
@gmarkall @leofang numba-cuda contains nvjitlink tests, should we maintain support for these as part of this PR or drop them in favor of testing in upstream |
I think we need to maintain the tests that test Numba-CUDA's interaction with the linker, like the |
Also, I think we can probably delete the I'm comfortable with:
which is what this PR seems to offer. (correct me if I've read it wrong 🙂) |
Correct, this is the outcome I am aiming for. |
@gmarkall on second thought, we might need to leave the MVCLinker in in some capacity as long as we're supporting cuda 11. I don't think that |
@brandon-b-miller Sorry, yes - I had that in mind but didn't write it down. |
Ok, just to have it written down somewhere, after this PR we will: For cuda 11, maintain the current way of configuring which bindings to use:
for cuda 12, we will have:
This will leave us with 3 linkers:
|
Thanks for the summary! To look a little further ahead, we want to end up with only one linker, which is the new linker. This would be achieved by deprecating / removing the other linkers as soon as appropriate:
Are you in alignment with the above plan @brandon-b-miller ? |
Yup this sounds good to me. |
self._object_codes.append(obj) | ||
|
||
|
||
def add_library(self, lib, name='<cudapy-lib>'): |
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.
There's a few cases in this class where I'm finding I have to do something like this. We discussed wanting to avoid having an ObjectCode
constructor for every type of possible input, but it seems like numba requires the ability to assemble the eventual inputs to the link from a pretty broad variety of sources.
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.
It seems like we need an API to be able to construct ObjectCode
instances from inputs of arbitrary kinds - archives, cubins, LTOIR, fatbins, etc.. It seems like the existing interface is aimed at providing something relatively safe, but doesn't allow for the lower-level / fine-grained control we need here to set up and complete a link.
Is that understanding correct?
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.
This is what I've arrived at doing, @leofang and I have had a few conversations about how this capability would fit into the broader goals of the cuda-python
API, I'd be curious his thoughts.
/ok to test |
WIP
xref #129