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 option to not flatten config in WandbLogger.log_hyperparams #14988

Closed
zephyap opened this issue Oct 4, 2022 · 6 comments · Fixed by #17574
Closed

Add option to not flatten config in WandbLogger.log_hyperparams #14988

zephyap opened this issue Oct 4, 2022 · 6 comments · Fixed by #17574
Labels
feature Is an improvement or enhancement good first issue Good for newcomers help wanted Open to be worked on logger: wandb Weights & Biases ver: 1.9.x
Milestone

Comments

@zephyap
Copy link

zephyap commented Oct 4, 2022

🚀 Feature

Reopening issue #9264: Make the config flattening that happens in WandbLogger.log_hyperparams optional.

Motivation

Similar to the original issue, flattening the config makes it harder to re-use later.

From the original issue:

Wandb support nested config by default. Furthermore, by flattening the configuration it makes it more difficult to load an experiment from a wandb run – instead of taking the config directly from the run, you have to un-flatten it first (or really, not use log_hyperparams and instead do it manually).

Pitch

Add flatten: bool = True as a kwarg in log_hyperparams.

Alternatives

  • Creating custom logger subclasses that do not flatten the config
    • Feels hacky, does not keep up well with new loggers being added.
  • Writing our own function to unflatten the config
    • Seems like a workable alternative, albeit a roundabout one. It adds one more moving piece to the system in order for configs to be reused, so my preference would still be to not flatten it at all, if possible.

cc @Borda @awaelchli @morganmcg1 @borisdayma @scottire @parambharat

@zephyap zephyap added the needs triage Waiting to be triaged by maintainers label Oct 4, 2022
@dsuess
Copy link

dsuess commented Oct 5, 2022

This would be a great feature to add. Note that since #2458, Wandb has added support to properly display non-flattened configs in their UI. Since we often don't control where log_hyperparams gets called, I think an init-argument to toggle this behaviour would be handy.

@rohitgr7 rohitgr7 added feature Is an improvement or enhancement logger: wandb Weights & Biases and removed needs triage Waiting to be triaged by maintainers labels Oct 5, 2022
@rohitgr7
Copy link
Contributor

rohitgr7 commented Oct 5, 2022

I think if it supports nested config, we shouldn't flatten it at all.

@mattcleigh
Copy link

Inspecting the hyperparameters on the wandb website is certainly easier without flattening, as it is presented as a collapsible dropdown list. I would definitely support adding in a flatten_hyperparams argument in the wandb logger init, or just removing the flattening step all together.

@stale
Copy link

stale bot commented Apr 14, 2023

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions - the Lightning Team!

@stale stale bot added the won't fix This will not be worked on label Apr 14, 2023
@zephyap
Copy link
Author

zephyap commented Apr 16, 2023

I'm still interested in this! But I understand if the team doesn't have time to work on it

@stale stale bot removed the won't fix This will not be worked on label Apr 16, 2023
@awaelchli awaelchli added the help wanted Open to be worked on label Apr 21, 2023
@awaelchli
Copy link
Contributor

awaelchli commented May 4, 2023

Another user who discovered this: #17559
Anyone here wants to send a PR to update the parameter sanitization not to flatten the dicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement good first issue Good for newcomers help wanted Open to be worked on logger: wandb Weights & Biases ver: 1.9.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants