Skip to content

Expose ObjectCode as public API #450

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 Feb 14, 2025 · 4 comments · Fixed by #435
Closed

Expose ObjectCode as public API #450

leofang opened this issue Feb 14, 2025 · 4 comments · Fixed by #435
Assignees
Labels
cuda.core Everything related to the cuda.core module feature New feature or request P0 High priority - Must do!

Comments

@leofang
Copy link
Member

leofang commented Feb 14, 2025

In recent design/impl discussions it became gradually clear to us that we want to separate JIT'ing from loading. This is also the general trend we have seen over the years (ex: why nvPTXCompiler becomes a standalone library). So:

  • Program for JIT’ing everything (PTX, NVVM, C++, Tile IR, …)
  • ObjectCode for loading

Here comes the catch. The only thing that can be loaded without JIT'ing is a cubin (which was the use case that exposed the bug #448). We need to ensure Program can JIT code either on disk or in memory.

@leofang leofang added cuda.core Everything related to the cuda.core module feature New feature or request P0 High priority - Must do! labels Feb 14, 2025
@leofang
Copy link
Member Author

leofang commented Feb 14, 2025

@ksimpson-work does this capture our discussions accurately?

@ksimpson-work
Copy link
Contributor

Yes I think this captures the issue well. Can you clarify on disk vs in memory in this context? Host / device? The solution is not obvious to me. There's a lot to consider!

@leofang
Copy link
Member Author

leofang commented Feb 14, 2025

It is not that complicated at all, it is really just the handling of cuLibraryLoadData (in memory) vs cuLibraryLoadFromFile (on disk), plus their CUfunction counterparts. We already have the code ready and we just need to fix #448.

@ksimpson-work
Copy link
Contributor

I mean specifically with respect to how we handle jit options. #435 #194. I almost wonder if PTX should be a supported code type of ObjectCode since it's not really an object code. Program.Compile('ptx') could return a new Program instance with code_type =='ptx'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.core Everything related to the cuda.core module feature New feature or request P0 High priority - Must do!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants