-
Notifications
You must be signed in to change notification settings - Fork 361
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
Implementing runtime parameter binding #1901
Conversation
…o metadata so that we can read time info from primitives
I downloaded your code, and compiled from qiskit-aer source, and set up
However, there is no significant acceleration in GPU operation time, so here is my code
|
I tested script above and time comparison is as followings;
I observed small speedup by using runtime parameter binding on GPU, but I think most of the time is spent outside of simulator in this case. |
|
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.
I think a major change to the existing code is introducing ResultItr
and it looks reasonable. Though I was not able to check the codes completely, added/modified codes look good. If they passed all the existing codes, merging this PR has no problem (assuming fixing bugs when they are found).
I left some very minor comments. If they are fixed, this PR looks good to be merged.
dump_vqe
Outdated
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.
Is this necessary?
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.
removed
qiskit_aer/backends/aer_simulator.py
Outdated
@@ -318,6 +318,12 @@ class AerSimulator(AerBackend): | |||
* ``accept_distributed_results`` (bool): This option enables storing | |||
results independently in each process (Default: None). | |||
|
|||
* ``runtime_parameter_bind_enable`` (bool): If this option is True | |||
parameters are binded at runtime by using multi-shots without constructing |
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.
binded
-> bound
because other descriptions use the latter in Aer.
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.
fixed
src/framework/operations.hpp
Outdated
@@ -940,6 +943,30 @@ inline Op make_qerror_loc(const reg_t &qubits, const std::string &label, | |||
return op; | |||
} | |||
|
|||
// make new op by parameter binding | |||
inline Op make_parameter_bind(const Op &src, const uint_t iparam, |
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.
I think this method name is bind_parameters()
.
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.
changed name to bind_parameter
because this function bind single parameter
Summary
This is new feature to optimize GPU simulation for single circuit with multiple parameters.
Before this PR, multiple circuits were given by binding parameters from a single circuit. This PR bind parameters to each gates at runtime on a single circuit with multiple shots of simulations, so we can speed up by combining batched execution on GPU.
Details and comments
Runtime parameter binding puts list of parameters to each operation and parameter is selected for each shot at runtime.
This option changes parallelization from multi-experiments to multi-shots.