-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add a kwarg for num_processes in the transpiler #11554
Conversation
…uits. Create new function to run circuits and pass it to parallel map.
Pull Request Test Coverage Report for Build 7658424322Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
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.
Thanks for opening this PR, I'm definitely in favor of adding this argument and this is a good start. I have some small concerns about the current implementation that I left an inline comment on. I think that we should be adding an equivalent num_processes
kwarg to the PassManager.run
method (which internally can call parallel_map
) definition and leverage that from inside transpile
.
releasenotes/notes/add-num-processes-kwarg-to-transpiler-3cb7f3457b54a535.yaml
Outdated
Show resolved
Hide resolved
…gh the transpiler. updated documentation
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 LGTM now, thanks for the quick update
Summary
fixes #9365
Add a kwarg to the transpiler which allows for overriding the user configs number of processes. As per this comment #9365 (comment) the order in which number of processes should be determined is the following:
Details and comments
This required modifications to the transpiler to serialize all of the instruction durations before running any of the circuits. I am unsure if this is the best way to go about serialization of the instruction durations and would welcome suggestions of a more straight forward way to achieve this. This also requires modifications to the parallel_map function to allow for None to be passed in as the number of processes and to take on the default specified by the user config or the environment variable.