Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unpin scipy & use threadpoolctl in minimize_with_timeout (#2712)
Summary: Scipy>=1.15 was leading to significant slowdowns in CI due to issues with OpenBLAS configuration (see scipy/scipy#22438). Thanks to suggestions by SciPy maintainers, we've found a solution that resolves the slowdown without modifying and global configurations for OpenBLAS. This PR wraps `minimize` calls in `minimize_with_timeout` in a `with threadpool_limits(limits=1, user_api="blas")` context, which makes OpenBLAS operate single-threaded within the context. Since PyTorch relies on OpenMP & MKL rather than OpenBLAS, this does not affect the evaluations of the acquisition functions or the MLL. Pull Request resolved: #2712 Test Plan: Compare runtimes in the following tutorial workflows Baseline - with scipy 1.14.1, without `threadpool_limits`: https://github.com/pytorch/botorch/actions/runs/13044166839/job/36391816602 With scipy 1.14.1, with `threadpool_limits`: https://github.com/pytorch/botorch/actions/runs/13044167834/job/36391818438 With scipy 1.15.1, with `threadpool_limits`: https://github.com/pytorch/botorch/actions/runs/13044245918/job/36392026548 Reviewed By: Balandat Differential Revision: D68874700 Pulled By: saitcakmak fbshipit-source-id: c6273bd43a8312e215204207bf92a765eb5201ce
- Loading branch information