Skip to content

Fix #781: Handle loops that include mid-circuit measurements - #787

Merged
schweitzpgi merged 1 commit into
NVIDIA:mainfrom
schweitzpgi:ch-i781
Oct 18, 2023
Merged

schweitzpgi merged 1 commit into
NVIDIA:mainfrom
schweitzpgi:ch-i781

Conversation

@schweitzpgi

@schweitzpgi schweitzpgi commented Oct 17, 2023 •

Copy link
Copy Markdown
Collaborator

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
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 Oct 17, 2023
@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 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
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 Oct 18, 2023

@1tnguyen 1tnguyen 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.

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