-
Notifications
You must be signed in to change notification settings - Fork 292
Various fixes for dynamic kernel loading #3507
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Thien Nguyen <[email protected]>
} | ||
target.platformName = foundPlatformName.value_or("default"); | ||
target.simulatorName = foundSimulatorName.value_or("qpp"); | ||
target.simulatorName = foundSimulatorName.value_or(""); |
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.
Does this mean the default won't be qpp
simulator anymore? Just curious to know what would the default option be?
target.simulatorName, target.platformName); | ||
std::string simName = target.simulatorName; | ||
if (simName.empty()) { | ||
// This target doesn't a simulator defined, e.g., hardware targets. |
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.
nit: doesn't have a
if (simName.empty()) { | ||
// This target doesn't a simulator defined, e.g., hardware targets. | ||
// We still need a simulator in case of local emulation. | ||
auto &defaultTargetInfo = targets[defaultTarget]; |
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.
Got it. Here is the default simulator.
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.
Yeah, without this, we're stuck with qpp
for all hardware emulation when running on Python, e.g., cannot use stim
for emulation of Clifford circuits.
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Description
(1) Allow override in
registerDeviceKernel
(2) Clear kernel decorator's
module
(parsed from walking the Python AST) as we switch target.The lack of this
module
attribute tells the decorator to perform a propercompile()
.Note: Other global maps might be populated during kernel constructor (i.e., as Python sees kernels); hence might not be safe to clear.
(3) Python to honor the default simulator environment variable for hardware target emulation. It was hardcoded to
qpp
for those targets that don't define a simulator.