Skip to content

Conversation

@felipemello1
Copy link
Contributor

@felipemello1 felipemello1 commented Oct 21, 2025

Before we would pass a whole dictionary as input to a logger backend and pop a selected few args

class LoggerBackend(ABC):
	def __init__(self, logger_backend_config: dict[str, Any]) -> None:
		self.project = logger_backend_config["project"]

This means that if users want to pass extra args, e.g. run name or tags, they couldnt.

Now we use **kwargs and pass it directly to the wandb run:

class LoggerBackend(ABC):
	def __init__(self, *, logging_mode, per_rank_share_run, **kwargs):
           self.backend_kwargs = kwargs

	...

	async def _init_per_rank(self, run_name: str):
        self.run = wandb.init(name=run_name, **self.backend_kwargs)

Tested it with multiple args. We can even pass a custom name. e.g.

logging_mode: global_reduce
image

logging_mode: per_rank_reduce
image

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 21, 2025
@wukaixingxp
Copy link
Contributor

LTGM, tested this branch with my yaml:

metric_logging:
  wandb:
    entity: "torchforge"
    project: "kaiwu-coding-grpo"
    logging_mode: global_reduce
  console:
    logging_mode: global_reduce

and saw
wandb: 🚀 View run royal-feather-3 at: https://meta.wandb.io/torchforge/kaiwu-coding-grpo/runs/8xpli7ro wandb: Find logs at: wandb/run-20251021_153007-8xpli7ro/logs

Copy link
Contributor

@wukaixingxp wukaixingxp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for helping me on the wandb issue!

@felipemello1 felipemello1 merged commit 8d7cb10 into meta-pytorch:main Oct 21, 2025
9 checks passed
@felipemello1 felipemello1 deleted the backend_args branch October 21, 2025 22:54
photomz pushed a commit to photomz/forge that referenced this pull request Oct 25, 2025
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.

2 participants