Skip to content

feat(logging): configure W&B identity and synchronize run ownership - #748

Open
shuangwu wants to merge 2 commits into
nvidia-cosmos:mainfrom
shuangwu:feat/wandb-run-identity
Open

shuangwu wants to merge 2 commits into
nvidia-cosmos:mainfrom
shuangwu:feat/wandb-run-identity

Conversation

@shuangwu

@shuangwu shuangwu commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Expose W&B run identity through typed logging configuration and fix cached run
ownership when applications initialize, finish, or replace the active SDK run.

  • Add logging.wandb_run_id, wandb_run_name, and wandb_resume; preserve
    timestamp-based defaults, existing project/group fields, and vision config behavior.
  • Adopt and return an already-active SDK run without reconfiguring it.
  • Clear stale handles on failed initialization and when the active run is
    finished/replaced; require explicit initialization to adopt a replacement.
  • Handle the absent optional SDK without an undefined-global failure.
  • Document ownership, defaults, and the single-active-run limitation.

This replaces the need for an application to intercept wandb.init to supply
launcher-derived identity. No launcher-specific environment parsing, report
filtering, or application-specific naming policy is added.

Validation

28 tests pass (test_wandb_identity.py and test_logging_level.py), covering
default/explicit identity, resume modes, invalid settings, repeated/external
initialization, failed initialization, finished/replaced runs, missing SDK,
and unchanged vision-generation identity. Tests use a fake SDK and make no
remote W&B calls. Ruff and git diff --check pass.

Independent of pending #747: based directly on upstream main, with none of that
PR's watchdog/launcher/unregister commits included.

Initialization policy

Initialization remains best-effort, including wandb_resume="must": SDK initialization errors are logged and training continues without W&B logging. wandb_resume=None defers to SDK settings, including environment configuration; it does not guarantee that resuming is disabled. An application-owned active run retains its existing identity and policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant