Tips for utilizing GPU with expected hypervolume improvement? #985
-
Hi everyone, I am working on a BO loop for an objective function that has 5 inputs and 3 outputs. I am using a multi-output SingleTaskGP, qExpectedHypervolumeImprovement, and a SobolQMCNormalSampler with 128 MC samples. My code runs fine when using objective functions with less than 3 outputs, and also runs when I use a small number of MC samples, such as 32. However, on the 3-output objective function (and other objectives with larger
Changing the max split size and even disabling CUDA memory caching in PyTorch do not change this. It seems computing qEHVI requires a very large amount of free memory, given the creation of tensors like Does anyone have tips for avoiding memory issues when using qEHVI in botorch? Is there anything I can do to alleviate this outside of adding resources? This is my first time applying GPU parallelization in a botorch loop. Thanks for any help. Some relevant questions:
edit: also noticing this issue and going to try the suggestions of the users there, though it's not clear to me whether this is the cause of my issues. In some cases, the CUDA error arises only after several iterations of BO. Additional information:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, thanks for the inquiry. Exact computation of HVI in the computation of EHVI can indeed be very memory intensive, as the time complexity for computing the hypervolume indicator itself scales super-polynomially with the number of objectives (see our paper for some discussion). However, we have found that by using approximate box decompositions (essentially choosing the Another way of reducing memory complexity would be to reduce the number of MC samples. |
Beta Was this translation helpful? Give feedback.
-
What batch size are you using? Is this q=1? For q > 3 or so, you will have much lower memory overhead using Couple other comments:
|
Beta Was this translation helpful? Give feedback.
Hi, thanks for the inquiry.
Exact computation of HVI in the computation of EHVI can indeed be very memory intensive, as the time complexity for computing the hypervolume indicator itself scales super-polynomially with the number of objectives (see our paper for some discussion).
However, we have found that by using approximate box decompositions (essentially choosing the
alpha
parameter in theNonDominatedPartitioning
greater than zero) can speed things up & reduce memory footprint significantly. Have you tried this?Another way of reducing memory complexity would be to reduce the number of MC samples.