Skip to content

Revisit the handling of jit_options for cuLibraryLoadData #194

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

Closed
leofang opened this issue Oct 28, 2024 · 3 comments · Fixed by #435
Closed

Revisit the handling of jit_options for cuLibraryLoadData #194

leofang opened this issue Oct 28, 2024 · 3 comments · Fixed by #435
Assignees
Labels
breaking Breaking changes are introduced cuda.core Everything related to the cuda.core module feature New feature or request P1 Medium priority - Should do

Comments

@leofang
Copy link
Member

leofang commented Oct 28, 2024

Unfortunately as of today it's not possible to use this feature without also building the bindings from source (#73). Let's just disable this path entirely for the time being.

Originally posted by @leofang in #188 (comment)

@leofang leofang added P1 Medium priority - Should do feature New feature or request cuda.core Everything related to the cuda.core module labels Oct 28, 2024
@leofang leofang added this to the cuda.core beta 2 milestone Oct 28, 2024
@leofang leofang added the triage Needs the team's attention label Nov 14, 2024
@leofang
Copy link
Member Author

leofang commented Jan 16, 2025

I feel this might have overlap with #317. We need to look into this @ksimpson-work.

@ksimpson-work
Copy link
Contributor

ksimpson-work commented Jan 30, 2025

I did a little bit of digging and This issue is somewhat perplexing. Currently the avenues for constructing an instance of ObjectCode are via the Linker.Link(), or via Program.compile(). For almost every situation, the jit options are handled by the LinkerOptions or ProgramOptions. The only case I currently see which does not obfuscate the options (and jitting all together) from cuModuleLoad is if someone links a bunch of PTX together and calls get_kernel on the resultant ptx CodeObject. This would trigger a lazy_load_module on the ptx without any particular options. Seeing as GetKernel does not provide an argument for options, this works.

The messy bit is in the _lazy_load_module logic, which does error handling for options which are never passed to it. I think if we agree that get_kernel() is never going to accept an options parameter (I personally think that it should not), then we can get rid of the options handling in lazy_load module since they will always == None. This takes into account an upcoming change (in review) to support Program instances with code_type=='ptx'. This will accept programOptions and use the linker as the backend to jit the ptx into cubin.

Let me know if you see holes in this.

@leofang
Copy link
Member Author

leofang commented Feb 2, 2025

Discussed offline, we agree that ObjectCode should not need to take jit_options; it's the job for Program which is being taken care of in #317. Let's just remove jit_options from ObjectCode constructor, since AFAIK it's not used anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking changes are introduced cuda.core Everything related to the cuda.core module feature New feature or request P1 Medium priority - Should do
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants