Skip to content
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

[core] Separate compilation, supporting C++ host side function references. #2216

Merged
merged 7 commits into from
Oct 1, 2024

Conversation

schweitzpgi
Copy link
Collaborator

These changes add a new wrapper class to support interfacing between kernels. Kernels on the device side have their own names and calling conventions. Meanwhile, the C++ host code can capture references to these kernels. The C++ compiler assumes it can erase the functions completely and degenerate any reference to them as a pointer. Furthermore, it may inline or wrap this code in a thicket of template instantiations. But in order to be useful on the device side, the CUDA-Q runtime must be able to determine which kernel was wrapped in C++ code, lookup the device side code, and "link-time" optimize these calls, doing calling convention conversions, etc. Furthermore, what must be done is flavored by the execution environment.

Update the call paths of hybridLaunchKernel so that we can use the new argument synthesis instead of falling back on and failing with quake synthesis A couple of init state tests are marked XFAIL as they don't seem to behave with the new argument synthesis..

@schweitzpgi schweitzpgi marked this pull request as draft September 18, 2024 15:26
@schweitzpgi schweitzpgi marked this pull request as ready for review September 18, 2024 16:35
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 18, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 18, 2024
Copy link
Collaborator

@1tnguyen 1tnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@schweitzpgi schweitzpgi enabled auto-merge (squash) September 18, 2024 22:28
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 19, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 19, 2024
github-actions bot pushed a commit that referenced this pull request Sep 19, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

1 similar comment
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 19, 2024
@schweitzpgi schweitzpgi force-pushed the ch-first.class.kernels branch 2 times, most recently from d2924da to 11a69e8 Compare September 26, 2024 16:16
@schweitzpgi schweitzpgi enabled auto-merge (squash) September 26, 2024 19:38
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 27, 2024
@schweitzpgi schweitzpgi force-pushed the ch-first.class.kernels branch 2 times, most recently from 3177732 to 0df0f68 Compare September 27, 2024 15:05
…nces.

These changes add a new wrapper class to support interfacing between
kernels. Kernels on the device side have their own names and calling
conventions. Meanwhile, the C++ host code can capture references to
these kernels. The C++ compiler assumes it can erase the functions
completely and degenerate any reference to them as a pointer.
Furthermore, it may inline or wrap this code in a thicket of template
instantiations. But in order to be useful on the device side, the CUDA-Q
runtime must be able to determine which kernel was wrapped in C++ code,
lookup the device side code, and "link-time" optimize these calls, doing
calling convention conversions, etc. Furthermore, what must be done is
flavored by the execution environment.

Update the call paths of hybridLaunchKernel so that we can use the new
argument synthesis instead of falling back on and failing with quake
synthesis.

Add another deduction guide test (when using cudaq::sample). Mark all
tests that use deduction guides as C++ 20 (since C++ 17 doesn't have
guides).

Add a hacky workaround for python. Python needs to use the new argument
synthesis, but it is still using the old quake synthesis compiler pass.

Attempt to add split-file to installed stuff. [Doesn't work! Why not?]
Add guards to tests since some phases of the CI don't have the necessary
test utilities properly installed.

Mark failing state tests as UNSUPPORTED for now. These should be fixed
when the state handling using new argument synthesis is fully
implemented.

Fix bug when there are multiple callables.
github-actions bot pushed a commit that referenced this pull request Sep 30, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Sep 30, 2024
Copy link

github-actions bot commented Oct 1, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Oct 1, 2024
@schweitzpgi schweitzpgi merged commit edc4346 into NVIDIA:main Oct 1, 2024
130 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2024
@schweitzpgi schweitzpgi deleted the ch-first.class.kernels branch October 1, 2024 01:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants