Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

[Feature] Expose additional arguments for Wandb #201

Merged
merged 7 commits into from
May 13, 2025

Conversation

Xmaster6y
Copy link
Contributor

What does this PR do?

It exposes wandb_extra_kwargs in the experiment config to pass additional arguments to both WandbLogger and wandb.init.

To discuss

  • Should there be an extra validation in ExperimentConfig, e.g. using a field like:
@dataclass
class WandbExtraKwargs:
    """
    Extra kwargs for wandb.
    """
    # WandbLogger
    offline: bool = False
    ...
    # wandb.init
    entity: Optional[str] = None
    ...
  • Is having wandb as a default logger (base_experiment) really ideal?

Happy to iterate.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 29, 2025
Copy link
Contributor

@matteobettini matteobettini left a comment

Choose a reason for hiding this comment

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

This looks great, sorry for taking so long. Only one point about bc-breaking

# WandbLogger includes: offline, save_dir, project, video_fps
# wandb.init includes: entity, tags, notes, etc.
wandb_extra_kwargs:
project: "benchmarl"
Copy link
Contributor

Choose a reason for hiding this comment

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

So the only problem is that this is backwards compatibility breaking and I would like to avoid that.

What about we keep the project name out and have wandb_extra_kwargs: {}?

Then is someone provides the project in wandb_extra_kwargs and it is different from project_name we tell them through an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get you, sounds good.

@Xmaster6y
Copy link
Contributor Author

Some unrelared failed checks, it seems.

Copy link
Contributor

@matteobettini matteobettini left a comment

Choose a reason for hiding this comment

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

LGTM!

cfg_dict_checked = _type_check_task_config(
environment_name, inner_task_name, cfg_dict_checked
) # Only needed for the warning
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to run the check anyway no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry I commited a modification linked to another upcoming request 🙈

@matteobettini matteobettini merged commit 567acd9 into facebookresearch:main May 13, 2025
15 of 17 checks passed
@Xmaster6y Xmaster6y deleted the wandb branch May 14, 2025 08:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants