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

Re-investigate parallel_map default number of CPU strategy #10868

Open
mtreinish opened this issue Sep 20, 2023 · 1 comment
Open

Re-investigate parallel_map default number of CPU strategy #10868

mtreinish opened this issue Sep 20, 2023 · 1 comment
Labels

Comments

@mtreinish
Copy link
Member

mtreinish commented Sep 20, 2023

What should we add?

Right now the default number of CPUs used with parallel_map is the number of physical CPUs available:

CPU_COUNT = CONFIG.get("num_process", local_hardware_info()["cpus"])
which is pulled from psutil here:
"cpus": psutil.cpu_count(logical=False) or 1,

This was done at the time because benchmarking showed that there was minimal if any improvement from running parallel processes on logical cores (i.e. SMT or hyperthreading cores). However, this code was introduced ~5 years ago (see: #701), we should check that this assumption is still true on more modern hardware. We should check this on various CPU types and also different OSes (also remembering multiprocessing is disabled by default on macOS and windows, so it will need to be explicitly re-enabled to test this).

@jakelishman
Copy link
Member

As part of this, it would be useful to have a less hacky way to force parallelisation in parallel_map, if not only for our own testing purposes. It seems quite likely at the moment that the internal dispatch logic is resistant to the attempts to override qiskit.tools.parallel.PARALLEL_DEFAULT in the CI suite, and (at least) macOS Azure jobs intended to test transpiler parallelism aren't actually running in parallel contexts.

@mtreinish mtreinish removed this from the 1.0.0 milestone Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants