-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor HpoService #9
Conversation
Hi @dinogun where is the best place to discuss the ideas behind this PR. Here or slack? |
@johnaohara Thanks for the PR, @khansaad is working on the thread changes as well, but looks like you beat him to it! Let me open issues so that we have better co-ordination here. |
Fixes #10 |
@dinogun @khansaad thats great. Yeah, opening an issue to discuss would be great. I am not wedded to these changes, If there is a different impl being worked on, that's great as well. This PR was really to do the ground work for this branch: https://github.com/johnaohara/hpo/tree/gRPC I am integrating HPO into our workflows, so I have created a python gRPC cli client (https://github.com/johnaohara/hpo/blob/gRPC/src/gRPC_client.py) and have a Java client as well (have not pushed it anywhere yet) |
@dinogun one question I did have was how do you run the test suite? I see it is lifted from the Autotune project, but can not see how to run the HPO tests |
@chandrams is updating the tests, she will be submitting a PR shortly |
I think the changes are looking good here! so we can continue to use this PR |
de35152
to
540a2ac
Compare
- Decouple REST service from optuna_hpo with a new class HpoService. Allow further apis to be introduced - Managed thread creation in hpo_service - Use Thread wait()/notify() to sync threads for providing trial data to optuna Objective function - Use Thread wait()/notify() to sync threads when a new experiment is started - Sync rest and experiment threads to ensure experiment is ready before returning from rest call - Ensure thread safe access to TrialDetails objects
540a2ac
to
d6ad505
Compare
There is not currently a working testsuite, so testing these changes have been performed using the following script;
Output from current main branch;
Output from this PR;
|
AFAICS the behaviour is unchanged |
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.
Looking good! One question, do we need to handle spurious wakeups with threading.Condition()
? I guess we can add that in a separate PR. Also something that @khansaad can take a look at.
@dinogun no, interrupted threads are not handled in this PR. There are a number of areas for improvement;
I am not proficient in Python, the most I have used it for previously is writing some simple scripts, so would either need to research these concerns, or leave for someone who has more experience |
This is looking great, thanks for your contribution. @khansaad will take up the improvements in a separate PR! |
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.
LGTM
HpoService. This allow further apis to be introduced
to and optuna Objective function
started
returning from rest call