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

Segmentation fault during circuit simulation for large number of controlled gates #1735

Merged
merged 2 commits into from
May 30, 2024

Conversation

schweitzpgi
Copy link
Collaborator

@schweitzpgi schweitzpgi commented May 30, 2024

When a temporary has a constant size, it can be promoted to the entry block. This eliminates any control dependence that may creep in when the temporary, if added inline, may be in a block with control dependence. Leans into LLVM being able to do live range analysis and fuse/eliminate these allocations.

Add a new function in the factory to generate the pattern in LLVM-IR dialect.

Fixes #1703. Adds regression test.

When a temporary has a constant size, it can be promoted to the entry
block. This eliminates any control dependence that may creep in when the
temporary, if added inline, may be in a block with control dependence.
Leans into LLVM being able to do live range analysis and fuse/eliminate
these allocations.

Add a new function in the factory to generate the pattern in LLVM-IR
dialect.

Fixes NVIDIA#1703.  Adds regression test.
@schweitzpgi schweitzpgi requested a review from bmhowe23 May 30, 2024 18:30
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 May 30, 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.

Thanks, Eric.

lib/Optimizer/Builder/Factory.cpp Outdated Show resolved Hide resolved
@schweitzpgi schweitzpgi enabled auto-merge (squash) May 30, 2024 21:35
@schweitzpgi schweitzpgi merged commit f06e210 into NVIDIA:main May 30, 2024
125 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2024
@schweitzpgi schweitzpgi deleted the ch-1703.1 branch May 31, 2024 14:25
@bettinaheim bettinaheim changed the title Allocate temporaries in conversion to LLVM in entry block. Segmentation fault during circuit simulation for large number of controlled gates Jul 29, 2024
@bettinaheim bettinaheim added the bug fix To be listed under Bug Fixes 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
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.

Segfault during circuit simulation with 2^19 controlled rotation gates
3 participants