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
Decouple number of runs from active processes #20
Conversation
Hello @partiallytyped, now i understand what you wanted to do. This looks very good and i think it would make sense to include this into Hyperactive in the future. I have some questions/things to add:
|
Your suggestions sound good, I will add the changes and push it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to leave a formal review. The important points are:
- Commit to the dev branch
- The default n_jobs should be "auto" and internally set to the total number of runs. If you pass an int to n_jobs it should work like in your commit. This way it works better "out of the box".
Thanks again for your work!
Okay, very nice! I had an idea how to make this compatible with the current API. I would like your opinion. We could leave the n_jobs/n_runs (old/new) parameter in .add_search(...) and rename the new parameter in Hyperactive(...) to something else. Maybe one of those:
I guess you have more experience with multiprocessing. Which would you choose? |
I'd go with n_processes since joblib and multiprocess use processes instead of threads. Sorry for taking too long to respond, exams.. |
@partiallytyped, |
Hi Simon. This is what I had in mind, basically it allows joblib or multiprocessing to use to use
n_jobs
processes to executen_run
"jobs". Note that it is a breaking change.Solves:
Using n_jobs to get a large number of runs results in spawning too many processes which end up filling the memory and cause thrashing. The patch limits the number of active processes to
n_jobs
while still allowing hyperactive to executen_runs
times the optimization process.