Using 2D grid in cudaKronprod for state initialization#4130
Merged
sacpis merged 4 commits intoNVIDIA:mainfrom Mar 11, 2026
Merged
Using 2D grid in cudaKronprod for state initialization#4130sacpis merged 4 commits intoNVIDIA:mainfrom
sacpis merged 4 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
schweitzpgi
reviewed
Mar 10, 2026
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Sachin Pisal <spisal@nvidia.com>
schweitzpgi
approved these changes
Mar 10, 2026
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using 2D grid in cudaKronprod to parallelize over both state dimensions.
Fixes QA bug 5961696.
The bug is in
kronprodwhich callscudaKronprodas a 1D grid. The kernel usesblockIdx.y / gridDim.yto go over the user state (for n = 30 qubits, it will be 1 billion elments), which is tsize2 parameter. Now, when gridDim.y = 1, only the first block ran. It went over all 2^n elements sequentially. Other blocks just launched and exited.The 2D grid shows that there are 65535 blocks each handling 4 chunks in parallel.
Used the code below
This change now executes the kernel within 1 minute.