Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory issues in multitask generator #57

Merged
merged 3 commits into from
Aug 18, 2022
Merged

Conversation

AngelFP
Copy link
Member

@AngelFP AngelFP commented Aug 16, 2022

When having a large number or samples (≳1000), the multitask generator was typically crashing due to out-of-memory errors, especially when running on a GPU. The crash happens while generating the next batch of configurations to evaluate, at the point where the acquisition function is optimized. This optimization begins by evaluating the acquisition function at 1000 points in a single batch (by default), which can result in a matrix that is larger than the available memory.

This PR adds the option of evaluating these points in several batches, so that each batch can actually fit in memory. This is done by passing the init_batch_limit to m.gen. Initially, the generator tries to optimize the acquisition function with init_batch_limit=1000. If this triggers an out-of-memory error, init_batch_limit is divided by 2 and a new trial is attempted. This process is repeated until the generator runs successfully.

Related issues: pytorch/botorch#366, cornellius-gp/gpytorch#647, cornellius-gp/gpytorch#1978.

@AngelFP
Copy link
Member Author

AngelFP commented Aug 16, 2022

Looks like setuptools is currently kind of broken (pypa/setuptools#3505) and impacting the installation of many packages. This is why the tests are failing.
The breaking changes in setuptools have been reverted. All tests passing now. 👍

@RemiLehe RemiLehe merged commit 99da90f into main Aug 18, 2022
@AngelFP AngelFP deleted the fix_memory_issues branch August 19, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants