Skip to content

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

@zephyap

Description

@zephyap

🚀 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions