Conversation
|
Rebased to master since #2369 is merged. |
|
Hi @emcastillo, any comment or suggestion? I am fine with either a red light or a green light. |
|
The basic direction looks good to me. I would like to reconsider the naming of the classes/methods including existing ones because they look confusing. The current PR uses the following names:
The following is one idea of renaming them:
If it sounds weird, feel free to have a discussion here. @emcastillo Could you also check the implementation? |
|
Hi @beam2d, thank you for kicking off the discussion! Let me first correct a few typos in your nice summary for the current PR:
(The corrections are 1. I am fine with the renaming as long as you think it's ok to make changes to internal APIs. My preference is to not rename; instead, perhaps simply exposing In addition, I also considered
when creating the PR. I didn't choose the name Thanks! |
|
Oh thank you for fixing many typos, I was so careless! Just exposing the name As for |
|
I'll take a look at it tomorrow first thing on the morning! :) |
@beam2d did you mean
OK glad to know we are aligned! For others please feel free to leave your feedback. I'll start making changes today, but this is a dynamic PR and things can change if deemed necessarily for providing a sustainable and useful public API. |
|
The current implementation LGTM, it is clean and straightforward. |
Ah, yes! I should take more sleep...zzz |
🤝 |
|
OK, based on the above discussion I made a few small changes. I also added docstring, tutorial, and test. This is ready for review now, @emcastillo. If you'd like to wait and see if other CuPy devs have feedback and/or suggestions, by all means. Thanks! This is off topic: Since I touched |
|
The PR looks good to me, but since its a big feature I would like other people to check it too. |
|
Jenkins, test this please |
|
Jenkins CI test (for commit aa5199e, target branch master) succeeded! |
|
Thanks to all CuPy core devs! It's been a long way since my first PR #1889! |
Summary
This PR is built upon, and thus blocked by, Allow getting and setting CUDA kernel attributes #2369.Rationale
(This also serves as a refreshment of what's discussed/done early on...)
cupy.cuda.function.Module()was intended to be used as private API;RawKernel.compile(long_code)can be used as a public API, which was implemented in Add RawKernel.compile() method #1889;RawKernel.compile()returns aModuleinstance, notRawKernel, which could be misleading/confusing;RawKernelnow has function attributes, and it'd be nice if each of the CUDA kernels compiled from the same source code can possess attributes independently, but Add RawKernel.compile() method #1889 does not meet this need;cupy.RawModule.get_function(kernel_name)returns aRawKernelinstance;cupy.RawModule()can be initialized either by a CUDA source code (same asRawKernel; the compilation is done at initialization) or by loading an existing CUDA cubin.I'd like to discuss with core devs to see if this PR makes better sense
before proceeding to docs, tests (tested locally), and further refinement.Thanks.UPDATE: The module name is changed to
RawModuleas discussed below.