Previously, we placed threadpoolctl in the optimizer in order to force OpenBLAS to run with only one thread in CMA-ES. However, this meant that all emitters would be affected by OpenBLAS, including ones defined by users. This commit moves threadpoolctl out of the optimizer and into CMA-ES, so that we only limit OpenBLAS in our code.
In #51, we mentioned that moving threadpoolctl to CMA-ES failed due to the overhead of creating the context manager. The new decorator from threadpoolctl seems to resolve this.
Here are some approximate times from running the sphere example (python examples/sphere.py cma_me_imp --dim 20 and python examples/sphere.py cma_me_imp --dim 100) with the different ways of calling threadpoolctl. Note that when threadpoolctl is disabled, the multithreading in OpenBLAS causes race conditions which slow down the execution (see #51).
Description
Previously, we placed threadpoolctl in the optimizer in order to force OpenBLAS to run with only one thread in CMA-ES. However, this meant that all emitters would be affected by OpenBLAS, including ones defined by users. This commit moves threadpoolctl out of the optimizer and into CMA-ES, so that we only limit OpenBLAS in our code.
In #51, we mentioned that moving threadpoolctl to CMA-ES failed due to the overhead of creating the context manager. The new decorator from threadpoolctl seems to resolve this.
Here are some approximate times from running the sphere example (
python examples/sphere.py cma_me_imp --dim 20
andpython examples/sphere.py cma_me_imp --dim 100
) with the different ways of calling threadpoolctl. Note that when threadpoolctl is disabled, the multithreading in OpenBLAS causes race conditions which slow down the execution (see #51).TODO
Questions
Status
yapf
pytest
pylint
HISTORY.md