Question about running botorch on GPU #1140
-
Hello all,
Should I apply any other modifications to the code above to make sure all possible steps are running on GPU not CPU? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As it's written, your code should be running on the If you're asking because you are not observing significant speed ups from switching to GPU, this is expected. You're using the analytic EI acquisition function, which does not use expensive matrix-vector multiplication, where the GPUs are typically much faster. We generally recommend GPUs for multi-objective optimization or for acquisition functions that require large q-batch sampling from the GP posterior. |
Beta Was this translation helpful? Give feedback.
As it's written, your code should be running on the
device
specified bytkwargs
. So, if you have PyTorch setup with cuda support and you have an nvidia GPU available, it should be running on the GPU. You can check this by printing outtkwargs
ortorch.cuda.is_available()
.If you're asking because you are not observing significant speed ups from switching to GPU, this is expected. You're using the analytic EI acquisition function, which does not use expensive matrix-vector multiplication, where the GPUs are typically much faster. We generally recommend GPUs for multi-objective optimization or for acquisition functions that require large q-batch sampling from the GP posterior.