Motivation
Dear BoTorch community,
I realized that when optimizing the acquisition function with any optimize_acqf (continuous, discrete, local search), a final evaluation of the acqf is performed in order to return the acq values.
From some memory profiling I have been running recently, it seems like this call is pretty memory intensive especially for the optimize_discrete_local_search since performed jointly (see here). In my specific case, such call is useless as I am only interested in returning the optimized candidates and I am not using the acq_values.
In order to avoid this unnecessary computation, I would like to make this computation optional.
Describe the solution you'd like to see implemented in BoTorch.
The easiest way to do it in my opinion would be to add a flag return_acq_value for example to the optimize_acqfs args. If true, then the joint evaluation is performed. Otherwise it returns only the optimized candidates.
For the implementation, I could imagine maybe the acqf returning a tuple(candidates, None) when the bool is False and tuple(candidates, acq_values) otherwise. Not sure if it is the cleanest way to do it tho.
Describe any alternatives you've considered to the above solution.
For now, since in my code I don't need the acq_values. I just copied the methods in my code and removed the computation of the acq_values at the end of the optimization. My function is thus returning only the candidates.
Is this related to an existing issue in BoTorch or another repository? If so please include links to those Issues here.
No response
Pull Request
Yes
Code of Conduct
Motivation
Dear BoTorch community,
I realized that when optimizing the acquisition function with any
optimize_acqf(continuous, discrete, local search), a final evaluation of the acqf is performed in order to return the acq values.From some memory profiling I have been running recently, it seems like this call is pretty memory intensive especially for the
optimize_discrete_local_searchsince performed jointly (see here). In my specific case, such call is useless as I am only interested in returning the optimized candidates and I am not using the acq_values.In order to avoid this unnecessary computation, I would like to make this computation optional.
Describe the solution you'd like to see implemented in BoTorch.
The easiest way to do it in my opinion would be to add a flag
return_acq_valuefor example to theoptimize_acqfs args. If true, then the joint evaluation is performed. Otherwise it returns only the optimized candidates.For the implementation, I could imagine maybe the acqf returning a tuple(candidates, None) when the bool is False and tuple(candidates, acq_values) otherwise. Not sure if it is the cleanest way to do it tho.
Describe any alternatives you've considered to the above solution.
For now, since in my code I don't need the acq_values. I just copied the methods in my code and removed the computation of the acq_values at the end of the optimization. My function is thus returning only the candidates.
Is this related to an existing issue in BoTorch or another repository? If so please include links to those Issues here.
No response
Pull Request
Yes
Code of Conduct