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

Add hparams API #129

Merged
merged 31 commits into from
Jul 18, 2023
Merged

Add hparams API #129

merged 31 commits into from
Jul 18, 2023

Conversation

JamieMair
Copy link
Contributor

@JamieMair JamieMair commented Jul 13, 2023

Continues work from #77.

EDIT: This now works! Closes #87

@oxinabox
Copy link
Member

oxinabox commented Jul 14, 2023

I am excited about this feature.

@oxinabox oxinabox requested a review from nomadbl July 14, 2023 18:09
nomadbl

This comment was marked as duplicate.

Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
Signed-off-by: Jamie Mair <JamieMair@users.noreply.github.com>
@JamieMair JamieMair marked this pull request as ready for review July 17, 2023 15:18
@JamieMair
Copy link
Contributor Author

@oxinabox @nomadbl I have finished the feature. The way that dictionary was serialised was actually wrong in the protobuf code, so I made it match the output of tensorboardX now. Thankfully, this fixed the issue of only one parameter showing up.

I have added some docs as well on how to use it, along with an example script. Should be simple enough as users should only really interact with write_hparams!.

Note, I also bumped the version of the package as well. Should be no breaking changes as this only adds functionality.

@nomadbl
Copy link
Contributor

nomadbl commented Jul 17, 2023

There's some really great work here, kudos.
However it looks like this points to a bug in Protobuf.jl.
The functions which are edited here already exist in https://github.com/JuliaIO/ProtoBuf.jl/blob/master/src/codec/encode.jl
Please file an issue there, as your understanding of the inner workings there is better than mine.
We should probably wait until we resolve it there and then we wouldn't need to add functions on our end which may break in the future if any changes to Protobuf.jl are made.

@JamieMair
Copy link
Contributor Author

There's some really great work here, kudos.

Thanks!

However it looks like this points to a bug in Protobuf.jl.

I have opened an issue (JuliaIO/ProtoBuf.jl#233) and PR (JuliaIO/ProtoBuf.jl#234), but these would be breaking changes for any downstream users, so I think that there is a chance that they might not accept the changes - it may take a while for this to go anywhere.

We should probably wait until we resolve it there and then we wouldn't need to add functions on our end which may break in the future if any changes to Protobuf.jl are made.

As the added methods have strict types, only applying to the HParams plugin, how would you feel about merging these changes now, as any changes in ProtoBuf may take a while/not happen? I have added a unit test with what the exact serialisation and deserialisation should be, which will make it easier to transition to any upstream fixes while verifying that tensorboard can still parse the output.

Copy link
Contributor

@nomadbl nomadbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with the precautions you have added it is reasonable to merge this now.
Thanks for taking care of the Protobuf issue and PR as well!

I have added another suggestion and approved the PR. Merge as you see fit.

test/test_hparams.jl Outdated Show resolved Hide resolved
@JamieMair
Copy link
Contributor Author

@nomadbl Thanks for the quick review and guidance. I'll updated from master and will merge as soon as the unit tests pass.

@JamieMair
Copy link
Contributor Author

@nomadbl I have realised that I don't actually have write access, I think someone else would need to merge the changes. Thanks :)

@nomadbl nomadbl merged commit 46ccf1d into JuliaLogging:master Jul 18, 2023
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.

3 participants