-
Notifications
You must be signed in to change notification settings - Fork 196
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
Always clear threadToQpuId
when we clear platformQPUs
#2478
Always clear threadToQpuId
when we clear platformQPUs
#2478
Conversation
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good find, Thien. Do we also need similar changes here?
platformQPUs.clear(); |
platformQPUs.clear(); |
(Those changes also do platformQPUs.clear()
and would therefore seem to invalidate threadToQpuId
, if it existed.
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thien Nguyen <thiennguyen@nvidia.com>
Good point. Added in b0b5f4a. I think for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Description
We should clear
threadToQpuId
when we initialize theplatformQPUs
list (clear then repopulate).The runtime has a static quantum platform instance, hence there could be stray info between run.
For example, a previous run with
nvidia-mqpu
may populatethreadToQpuId
based on the number of GPUs. Then, a subsequentremote-mqpu
run may have a collision when looking upthreadToQpuId
with thread id => out of bound access to theplatformQPUs
map.This is primarily a Python specific bug as we cannot switch targets with C++.