|
1 | 1 | --- |
2 | | -id: concepts |
3 | | -title: Terminology and Concepts |
4 | | -sidebar_label: Terminology and Concepts |
| 2 | +id: logger |
| 3 | +title: Weights and Biases Logging |
| 4 | +sidebar_label: Weights and Biases Logging |
5 | 5 | --- |
6 | 6 |
|
7 | 7 | ## Weights and Biases Logger |
8 | 8 |
|
9 | | -MMF has a `WandbLogger` class which lets the user to log their model's progress using [Weights and Biases](https://gitbook-docs.wandb.ai/). |
| 9 | +MMF now has a `WandbLogger` class which lets the user to log their model's progress using [Weights and Biases](https://wandb.ai/site). Enable this logger to automatically log the training/validation metrics, system (GPU and CPU) metrics and configuration parameters. |
| 10 | + |
| 11 | +## First time setup |
10 | 12 |
|
11 | 13 | To set up wandb, run the following: |
12 | 14 | ``` |
13 | 15 | pip install wandb |
| 16 | +``` |
| 17 | +In order to log anything to the W&B server you need to authenticate the machine with W&B **API key**. You can create a new account by going to https://wandb.ai/signup which will generate an API key. If you are an existing user you can retrieve your key from https://wandb.ai/authorize. You only need to supply your key once, and then it is remembered on the same device. |
| 18 | + |
| 19 | +``` |
14 | 20 | wandb login |
15 | 21 | ``` |
16 | 22 |
|
| 23 | +## W&B config parameters |
| 24 | + |
17 | 25 | The following options are available in config to enable and customize the wandb logging: |
18 | 26 | ```yaml |
19 | 27 | training: |
20 | 28 | # Weights and Biases control, by default Weights and Biases (wandb) is disabled |
21 | 29 | wandb: |
22 | 30 | # Whether to use Weights and Biases Logger, (Default: false) |
23 | 31 | enabled: false |
| 32 | + # An entity is a username or team name where you're sending runs. |
| 33 | + # This is necessary if you want to log your metrics to a team account. By default |
| 34 | + # it will log the run to your user account. |
| 35 | + entity: null |
24 | 36 | # Project name to be used while logging the experiment with wandb |
25 | | - wandb_projectname: mmf_${oc.env:USER} |
| 37 | + wandb_projectname: mmf_${oc.env:USER,} |
26 | 38 | # Experiment/ run name to be used while logging the experiment |
27 | 39 | # under the project with wandb |
28 | 40 | wandb_runname: ${training.experiment_name} |
| 41 | + # Specify other argument values that you want to pass to wandb.init(). Check out the documentation |
| 42 | + # at https://docs.wandb.ai/ref/python/init to see what arguments are available. |
| 43 | + # job_type: 'train' |
| 44 | + # tags: ['tag1', 'tag2'] |
29 | 45 | env: |
30 | 46 | wandb_logdir: ${env:MMF_WANDB_LOGDIR,} |
31 | | -``` |
32 | | -To enable wandb logger the user needs to change the following option in the config. |
| 47 | +``` |
| 48 | +
|
| 49 | +* To enable wandb logger the user needs to change the following option in the config. |
| 50 | +
|
| 51 | + `training.wandb.enabled=True` |
| 52 | + |
| 53 | +* To give the `entity` which is the name of the team or the username, the user needs to change the following option in the config. In case no `entity` is provided, the data will be logged to the `entity` set as default in the user's settings. |
| 54 | + |
| 55 | + `training.wandb.entity=<teamname/username>` |
| 56 | + |
| 57 | +* To give the current experiment a project and run name, user should add these config options. |
| 58 | + |
| 59 | + `training.wandb.wandb_projectname=<ProjectName>` <br> |
| 60 | + `training.wandb.wandb_runname=<RunName>` |
| 61 | + |
| 62 | +* To change the path to the directory where wandb metadata would be stored (Default: `env.log_dir`): |
33 | 63 |
|
34 | | -`training.wandb.enabled=True` |
| 64 | + `env.wandb_logdir=<dir_name>` |
35 | 65 |
|
36 | | -To give the current experiment a project and run name, user should add these config options. |
| 66 | +* To provide extra arguments to `wandb.init()`, the user just needs to define them in the config file. Check out the documentation at https://docs.wandb.ai/ref/python/init to see what arguments are available. An example is shown in the config parameter shown above. |
37 | 67 |
|
38 | | -`training.wandb.wandb_projectname=<ProjectName> training.wandb.wandb_runname=<RunName>` |
| 68 | +## Current features |
39 | 69 |
|
40 | | -To change the path to the directory where wandb metadata would be stored (Default: `env.log_dir`): |
| 70 | +The following features are currently supported by the `WandbLogger`: |
41 | 71 |
|
42 | | -`env.wandb_logdir=<dir_name>` |
| 72 | +* Training & Validation metrics |
| 73 | +* Learning Rate over time |
| 74 | +* GPU: Type, GPU Utilization, power, temperature, CUDA memory usage |
| 75 | +* Log configuration parameters |
0 commit comments