Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check wandb login #2445

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nvflare/app_opt/tracking/wandb/wandb_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,18 @@ def initialize(self, fl_ctx: FLContext):
run_name = self.kwargs["name"]
job_id_tag = self.get_job_id_tag(run_group_id)
wand_config = self.kwargs.get("config", {})

try:
wandb.login(timeout=1, verify=True)
except Exception as e:
self.log_error(self.fl_ctx, f"Unsuccessful login: {e}. Using wandb offline mode.")
self.mode = "offline"

SYangster marked this conversation as resolved.
Show resolved Hide resolved
for site in sites:
self.log_info(self.fl_ctx, f"initialize WandB run for site {site.name}")
self.kwargs["name"] = f"{site.name}-{job_id_tag[:6]}-{run_name}"
self.kwargs["group"] = f"{run_name}-{job_id_tag}"
self.kwargs["mode"] = self.mode
wand_config["job_id"] = job_id_tag
wand_config["client"] = site.name
wand_config["run_name"] = run_name
Expand Down
Loading