Skip to content
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

Fix unnecessary serialisation of PassManager in serial contexts (backport #12410) #12500

Merged
merged 3 commits into from
Jun 8, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 4, 2024

Summary

This exposes the interal decision in parallel_map of whether to actually run in serial or not. If not, there's no need for PassManager to side-car its dill serialisation onto the side of the IPC (we use dill because we need to pickle lambdas), which can be an unfortunately huge cost for certain IBM pulse-enabled backends.

Details and comments

@sbrandhsn: as the release manager for 1.1.0, it's up to you whether you want to accept this PR in this form for 1.1.0, or defer to 1.1.1 (you can tag the milestone appropriately). I could also suppress exporting should_run_in_parallel into the public namespace if you're not on board with a new public feature this late into the release cycle.


This is an automatic backport of pull request #12410 done by Mergify.

…2410)

* Fix unnecessary serialisation of `PassManager` in serial contexts

This exposes the interal decision in `parallel_map` of whether to
actually run in serial or not.  If not, there's no need for
`PassManager` to side-car its `dill` serialisation onto the side of the
IPC (we use `dill` because we need to pickle lambdas), which can be an
unfortunately huge cost for certain IBM pulse-enabled backends.

* Remove new function from public API

This makes the patch series safe for backport to 1.1.

(cherry picked from commit b12e9ec)

# Conflicts:
#	qiskit/utils/__init__.py
#	qiskit/utils/parallel.py
@mergify mergify bot requested a review from woodsp-ibm as a code owner June 4, 2024 10:55
@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Jun 4, 2024
@mergify mergify bot requested a review from a team as a code owner June 4, 2024 10:55
Copy link
Contributor Author

mergify bot commented Jun 4, 2024

Cherry-pick of b12e9ec has failed:

On branch mergify/bp/stable/0.46/pr-12410
Your branch is up to date with 'origin/stable/0.46'.

You are currently cherry-picking commit b12e9ec3c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   qiskit/passmanager/passmanager.py
	new file:   releasenotes/notes/parallel-check-8186a8f074774a1f.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   qiskit/utils/__init__.py
	both modified:   qiskit/utils/parallel.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@qiskit-bot
Copy link
Collaborator

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 following people are relevant to this code:

  • @Qiskit/terra-core

@github-actions github-actions bot added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: transpiler Issues and PRs related to Transpiler affects extended support This issue (also) affects extended support labels Jun 4, 2024
@1ucian0 1ucian0 added this to the 0.46.2 milestone Jun 4, 2024
@coveralls
Copy link

coveralls commented Jun 7, 2024

Pull Request Test Coverage Report for Build 9419158300

Details

  • 12 of 12 (100.0%) changed or added relevant lines in 3 files are covered.
  • 39 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-0.04%) to 86.911%

Files with Coverage Reduction New Missed Lines %
qiskit/utils/parallel.py 2 65.67%
qiskit/passmanager/passmanager.py 4 87.37%
crates/qasm2/src/lex.rs 4 92.88%
crates/accelerate/src/euler_one_qubit_decomposer.rs 7 91.84%
crates/accelerate/src/sabre_swap/neighbor_table.rs 22 57.81%
Totals Coverage Status
Change from base Build 9314544782: -0.04%
Covered Lines: 74980
Relevant Lines: 86272

💛 - Coveralls

@1ucian0 1ucian0 added this pull request to the merge queue Jun 8, 2024
Merged via the queue into stable/0.46 with commit aa8e9bb Jun 8, 2024
11 checks passed
@mergify mergify bot deleted the mergify/bp/stable/0.46/pr-12410 branch June 8, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects extended support This issue (also) affects extended support Changelog: Bugfix Include in the "Fixed" section of the changelog conflicts used by mergify when there are conflicts in a port mod: transpiler Issues and PRs related to Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants