Skip to content

improve: surface extra wandb.init kwargs in WandbBackend (#594)#779

Open
lonexreb wants to merge 1 commit into
meta-pytorch:mainfrom
lonexreb:improve/594-wandb-kwargs-visibility
Open

improve: surface extra wandb.init kwargs in WandbBackend (#594)#779
lonexreb wants to merge 1 commit into
meta-pytorch:mainfrom
lonexreb:improve/594-wandb-kwargs-visibility

Conversation

@lonexreb

@lonexreb lonexreb commented Jun 6, 2026

Copy link
Copy Markdown

Summary

Addresses #594.

Anything you place under metric_logging.wandb: in a YAML config that isn't logging_mode or per_rank_share_run is forwarded verbatim to wandb.init via **kwargs. This already works — it just isn't obvious, so a user can mistype entity or mode and silently get a different run than they expected.

This PR makes it obvious in two complementary ways:

  1. Docstring — adds an explicit YAML example showing forwarded keys (entity, mode) alongside the named ones.
  2. Runtime — emits one INFO log at __init__ listing the extra kwargs being forwarded:
    WandbBackend: forwarding 3 extra kwarg(s) to wandb.init: ['entity', 'mode', 'project']
    

No behavior change for wandb itself; this is a visibility fix.

Test plan

  • New test_wandb_backend_logs_extra_kwargs — verifies INFO log lists forwarded keys
  • New test_wandb_backend_no_log_when_no_extra_kwargs — verifies silence when only named args passed
  • Existing test_wandb_backend_creation still passes (no API changes)

…log (meta-pytorch#594)

Anything under ``metric_logging.wandb:`` in YAML that isn't logging_mode or
per_rank_share_run is forwarded verbatim to wandb.init via **kwargs. The
prior docstring mentioned this in passing but didn't say "your YAML
arbitrary keys land here", and there was no runtime signal of what got
forwarded — making it easy to mistype ``entity`` or ``mode`` and not
notice.

This change:
- Expands the docstring with an explicit YAML example showing arbitrary
  forwarded keys (entity, mode) alongside the named ones.
- Emits a single INFO log at __init__ listing the extra kwargs being
  forwarded, e.g.:
    WandbBackend: forwarding 3 extra kwarg(s) to wandb.init:
    ['entity', 'mode', 'project']

No behavior change for wandb itself; this is a visibility fix.

Test plan:
- New: test_wandb_backend_logs_extra_kwargs verifies the INFO line lists
  the forwarded keys
- New: test_wandb_backend_no_log_when_no_extra_kwargs verifies silence
  when only the named args are passed
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant