-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: new format for the controller metrics and operations #130
feat: new format for the controller metrics and operations #130
Conversation
9af7f0a
to
fc7f015
Compare
a13f4e6
to
c68f06d
Compare
c68f06d
to
ac8e59f
Compare
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.
HI @HarikrishnanBalagopal, thanks for the contribution. I think the schema change looks reasonable, but would like to decouple the schema change and the schema validation to keep things as atomic as possible, especially since the schema validation adds a new dependency. Would you be able to split this into two PRs?
7e91273
to
02f4b96
Compare
@alex-jw-brooks Thanks for the review, I have removed the jsonschema dependency and schema validation code. PTAL |
02f4b96
to
064ed6b
Compare
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.
One small thing, but otherwise I think we can get this one merged, thanks!
tuning/trainercontroller/callback.py
Outdated
@@ -74,7 +76,8 @@ def __init__(self, trainer_controller_config: Union[dict, str]): | |||
if isinstance(trainer_controller_config, str): | |||
if os.path.exists(trainer_controller_config): | |||
with open(trainer_controller_config, "r", encoding="utf-8") as f: | |||
self.trainer_controller_config = yaml.safe_load(f) | |||
self.trainer_controller_config: dict = yaml.safe_load(f) | |||
assert isinstance(self.trainer_controller_config, dict) |
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.
can you change this to raise TypeError
if not isinstance(self.trainer_controller_config, dict)
instead of an assert?
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.
Done
# Add metric instances to the events. | ||
for event_name in obj.get_events(): | ||
for event_name in metric_handler.get_events(): |
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.
just a note in general - in the future it would be best to decouple minor changes and refactors from functional changes to keep PRs as small/atomic as possible, as it keeps the PRs easier to review and less likely to be in conflict with each other 🙂
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.
Yes, I will keep that in mind for the other PRs.
I take it we can keep this change for now?
19ba188
to
151b407
Compare
151b407
to
31680c5
Compare
Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
31680c5
to
4cb3a89
Compare
looks like this has been addressed - seems like I need to do this to merge
Description of the change
Standardized the format in the yaml files used by
TrainerControllerCallback
.Related issue number
#129
How to verify the PR
We have tests which can be run with
make test
Was the PR tested
Run
make test