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

[NVQC] Support direct kernel invocation with a return value #1969

Merged
merged 11 commits into from
Jul 25, 2024

Conversation

1tnguyen
Copy link
Collaborator

Description

For MLIR-based kernels, the kernel launch is bootstrapped; hence technically we can pack the return value back to users.

This PR enables that:

  • Add a flat-buffer in ExecutionContext to store this data.

  • Server side: introspect the entry-point kernel IR to know what type is being return. In this PR, only simple data types (float/int/bool) are supported.

  • Client side: check if buffer data is being returned from the server and the kernel launch is expecting some return value (via the return offset). If so, copy the data to return to users.

  • Adds tests for supported return types.

Compatibility

This is not a breaking change.
When both the client and service are updated, the return value will be available. Otherwise, no return value would be available (same as the existing behavior)

  • New client - old service: the service won't populate the buffer field in the return JSON.

  • Old client - new service: the buffer field in the return JSON would be dropped/ignored by the client.
     

Resolved #1597

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

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

Do we have an RFC someplace for this that scopes out the work, esp. the limitations?

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

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

1tnguyen and others added 4 commits July 20, 2024 04:08
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
…erver.cpp

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
…erver.cpp

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
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 Jul 19, 2024
Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

This looks like a good improvement to me, and it would be nice to be able to close the associated issue, so I'm in favor of putting this into the release.

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 Jul 22, 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 Jul 22, 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 Jul 23, 2024
Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

This LGTM. Thanks, Thien!

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 Jul 25, 2024
@1tnguyen 1tnguyen merged commit 478e00c into NVIDIA:main Jul 25, 2024
125 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
@bettinaheim bettinaheim added the release notes Changes need to be captured in the release notes label Jul 29, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release notes Changes need to be captured in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

random_walk_qpe.cpp not returning correct phase when run through NVQC
4 participants