KEMBAR78
Fix #781: Handle loops that include mid-circuit measurements by schweitzpgi · Pull Request #787 · NVIDIA/cuda-quantum · GitHub
Skip to content

Conversation

@schweitzpgi
Copy link
Collaborator

@schweitzpgi schweitzpgi commented Oct 17, 2023

Due to an interaction between the revised memtoreg pass and loop unrolling, the test with a mid-circuit measurement and a break statement still wasn't being unrolled. These changes fix that issue.

Primarily, these changes allow structured operations that accept region arguments to straddle the fence and allow some values to be promoted as dominating uses (when only used) while other values to be threaded as region arguments exactly as before (when written). This change simplifies the register-semantics IR. There may be a bit of performance lossage in memtoreg as a result however as promoted values may later be discovered to be written and the changes will need to be reapplied.

@schweitzpgi schweitzpgi added this to the release 0.5.0 milestone Oct 17, 2023
@github-actions
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 Oct 17, 2023
@github-actions
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 Oct 17, 2023
…asurement.

Due to an interaction between the revised memtoreg pass and loop
unrolling, the test with a mid-circuit measurement and a break statement
still wasn't being unrolled. These changes fix that issue.

Primarily, these changes allow structured operations that accept region
arguments to straddle the fence and allow some values to be promoted as
dominating uses (when only used) while other values to be threaded as
region arguments exactly as before (when written). This change
simplifies the register-semantics IR. There may be a bit of performance
lossage in memtoreg as a result however as promoted values may later be
discovered to be written and the changes will need to be reapplied.

Leave static unrolling pass in the kernel builder.
@github-actions
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 Oct 18, 2023
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 merged commit 6835a5a into NVIDIA:main Oct 18, 2023
@schweitzpgi schweitzpgi deleted the ch-i781 branch October 18, 2023 14:32
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
@bettinaheim bettinaheim changed the title Fix #781 Loop unrolling with break statement and mid-circuit measurem… Fix #781: Handle loops that include mid-circuit measurements Nov 15, 2023
@bettinaheim bettinaheim added the bug fix To be listed under Bug Fixes in the release notes label Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug fix To be listed under Bug Fixes in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants