Unpin scipy & use threadpoolctl in minimize_with_timeout #2712
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
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
minimizecalls inminimize_with_timeoutin awith 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.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/36391816602With scipy 1.14.1, with
threadpool_limits: https://github.com/pytorch/botorch/actions/runs/13044167834/job/36391818438With scipy 1.15.1, with
threadpool_limits: https://github.com/pytorch/botorch/actions/runs/13044245918/job/36392026548