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

Improve documentation and implementation of W&B options #236

Closed
utensil opened this issue Jun 23, 2023 · 4 comments · Fixed by #767
Closed

Improve documentation and implementation of W&B options #236

utensil opened this issue Jun 23, 2023 · 4 comments · Fixed by #767

Comments

@utensil
Copy link
Contributor

utensil commented Jun 23, 2023

  1. These options are essentially mapping to the W&B environment variables, for their usage, users need to search and check https://docs.wandb.ai/guides/track/environment-variables#optional-environment-variables , https://docs.wandb.ai/ref/python/watch etc. It might be good to add this link to the readme, and suggest a common usage
  2. The implementation could be optimized to just automatically map anything that starts with wandb_ to the same env var

discord discussion: https://discord.com/channels/1104757954588196865/1111279858136383509/1121703569029091412

@NanoCode012
Copy link
Collaborator

We need to make sure to migrate any old/incorrect configs and check for old env within validate_config..

@NanoCode012
Copy link
Collaborator

NanoCode012 commented Aug 12, 2023

Improved by #361

@NanoCode012
Copy link
Collaborator

Sorry, I accidentally closed

@NanoCode012 NanoCode012 reopened this Aug 12, 2023
@tcapelle
Copy link
Contributor

tcapelle commented Sep 20, 2023

Hello, W&B Eng here, I can help with this. Also we should probably not explicitly set the id as it's better if it is autogenerated. We could potentially give the user the option to setup the run_name, this is what gets displayed on the UI.
Basically, we replace this with the WANBD_NAME env variable.

We could probably have something like this:

def setup_wandb_env_vars(cfg):
    for key in cfg.__dict__:
        if key.startswith('wandb_'):
            value = cfg.get(key, "")
            if value and len(value) > 0:
                os.environ[key.upper()] = value
            elif key == 'wandb_mode' and value == "offline":
                os.environ["WANDB_MODE"] = value
            else:
                os.environ["WANDB_DISABLED"] = "true"

    # Enable wandb if project name is present
    if cfg.get('wandb_project', "") and len(cfg.get('wandb_project', "")) > 0:
        cfg.use_wandb = True

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 a pull request may close this issue.

3 participants