Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[minor][wandb] Save task arguments as separate config values #4484

Merged
merged 3 commits into from Apr 5, 2022

Conversation

moyapchen
Copy link
Contributor

Convenience so that we can do UI filters in wandb on values for task arguments.

Test plan:

    >>> from parlai.core.logs import WandbLogger
    >>> opt= {"wandb_name": "test_3", "wandb_project": "blah_2", "model_file": "dummy_mf", "task": "blah:x=y:a=2"}
    >>> dummy = WandbLogger(opt)
    >>> dummy.run.config
    {'wandb_name': 'test_3', 'wandb_project': 'blah_2', 'model_file': 'dummy_mf', 'task': 'blah:x=y:a=2', 'x': 'y', 'a': '2'}

Also ran a run on SLURM.

Moya Chen added 2 commits April 5, 2022 07:32
Convenience so that we can do UI filters in wandb on values for task arguments.

```
>>> from parlai.core.logs import WandbLogger
>>> opt= {"wandb_name": "test_3", "wandb_project": "blah_2", "model_file": "dummy_mf", "task": "blah:x=y:a=2"}
>>> dummy = WandbLogger(opt)
>>> dummy.run.config
{'wandb_name': 'test_3', 'wandb_project': 'blah_2', 'model_file': 'dummy_mf', 'task': 'blah:x=y:a=2', 'x': 'y', 'a': '2'}
Copy link
Contributor

@klshuster klshuster left a comment

Choose a reason for hiding this comment

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

nice fix, thanks

@moyapchen moyapchen merged commit f91bd80 into main Apr 5, 2022
@moyapchen moyapchen deleted the mpchen/task_arg_wandb branch April 5, 2022 20:37
if not self.run.resumed:
for key, value in opt.items():
if value is None or isinstance(value, (str, numbers.Number, tuple)):
setattr(self.run.config, key, value)
set_config_value(self, key, value)
if key == "task": # For ags specified in the task argument
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: spelling

@@ -181,14 +181,25 @@ def __init__(self, opt: Opt, model=None):
entity=opt.get('wandb_entity'),
reinit=True, # in case of preemption
resume=True, # requeued runs should be treated as single run
allow_val_change=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you leave a comment why

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants