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

feat: sync wandb add params #794

Merged
merged 1 commit into from
Jan 20, 2025
Merged

feat: sync wandb add params #794

merged 1 commit into from
Jan 20, 2025

Conversation

Zeyi-Lin
Copy link
Member

Description

此拉取请求包括对swanlab/sync/wandb.py文件中的sync_wandb函数的更新,以增强其功能并改善与Swanlab和Weights & Biases(wandb)库的集成。这些更改引入了新参数、额外的日志记录功能以及更好的配置处理。

sync_wandb函数的增强:

  • sync_wandb函数中添加了modewandb_run参数,以便更好地控制同步模式以及是否应将数据上传到wandb。(swanlab/sync/wandb.py
  • 更新了patched_init函数,以包含新的mode参数并处理wandb_run设置,如果wandb_run设置为False,则允许离线模式。(swanlab/sync/wandb.py

配置和日志记录改进:

  • 引入了patched_config_update函数,以便在wandb的配置更新时更新Swanlab的配置。(swanlab/sync/wandb.py
  • 修补了wandb配置更新方法,以使用新的patched_config_update函数。(swanlab/sync/wandb.py

Closes: #793

@Zeyi-Lin
Copy link
Member Author

测试代码:

import wandb
import random
import swanlab

swanlab.sync_wandb(mode="local", wandb_run=False)

wandb.init(
  project="wandb_test",
  config={"a": 1, "b": 2},
  name="test",
  )

wandb.config.update({"c": 3})

epochs = 10
offset = random.random() / 5
for epoch in range(2, epochs):
  acc = 1 - 2 ** -epoch - random.random() / epoch - offset
  loss = 2 ** -epoch + random.random() / epoch + offset

  wandb.log({"acc": acc, "loss": loss})

@Zeyi-Lin Zeyi-Lin requested a review from SAKURA-CAT January 20, 2025 07:11
@Zeyi-Lin Zeyi-Lin self-assigned this Jan 20, 2025
@Zeyi-Lin Zeyi-Lin added the 💪 enhancement New feature or request label Jan 20, 2025
@SAKURA-CAT SAKURA-CAT merged commit 2dc6db9 into main Jan 20, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feat-sync-wandb-mode branch January 20, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQUEST] sync wandb增加mode选择
2 participants