Skip to content

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

Merged
1tnguyen merged 11 commits into
NVIDIA:mainfrom
1tnguyen:tnguyen/issue-1597
Jul 25, 2024
Merged

1tnguyen merged 11 commits into
NVIDIA:mainfrom
1tnguyen:tnguyen/issue-1597

Conversation

@1tnguyen

Copy link
Copy Markdown
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

Comment thread runtime/common/BaseRemoteSimulatorQPU.h Resolved

@schweitzpgi schweitzpgi left a comment

Copy link
Copy Markdown
Collaborator

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?

Comment thread runtime/common/ExecutionContext.h Resolved
Comment thread runtime/common/ExecutionContext.h Resolved
github-actions Bot pushed a commit that referenced this pull request Jul 19, 2024
@github-actions

Copy link
Copy Markdown

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>
@github-actions

Copy link
Copy Markdown

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

@bmhowe23 bmhowe23 left a comment

Copy link
Copy Markdown
Collaborator

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.

@github-actions

Copy link
Copy Markdown

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
@github-actions

Copy link
Copy Markdown

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
@github-actions

Copy link
Copy Markdown

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

@bmhowe23 bmhowe23 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This LGTM. Thanks, Thien!

@github-actions

Copy link
Copy Markdown

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
@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