Parallelize your W&B Sweep agents on a multi-core or multi-GPU machine. Before you get started, ensure you have initialized your W&B Sweep. For more information on how to initialize a W&B Sweep, see Initialize sweeps.Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-weave-caching.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Parallelize on a multi-CPU machine
Depending on your use case, explore the proceeding tabs to learn how to parallelize W&B Sweep agents using the CLI or within a Jupyter Notebook.- CLI
- Jupyter Notebook
Use the
wandb agent command to parallelize your sweep agent across multiple CPUs with the terminal. Provide the sweep ID that was returned when you initialized the sweep.- Open more than one terminal window on your local machine.
- Copy and paste the code snippet below and replace
sweep_idwith your sweep ID:
Parallelize on a multi-GPU machine
Follow the procedure outlined to parallelize your W&B Sweep agent across multiple GPUs with a terminal using CUDA Toolkit:- Open more than one terminal window on your local machine.
- Specify the GPU instance to use with
CUDA_VISIBLE_DEVICESwhen you start a W&B Sweep job (wandb agent). AssignCUDA_VISIBLE_DEVICESan integer value corresponding to the GPU instance to use.
CUDA_VISIBLE_DEVICES to 0 (CUDA_VISIBLE_DEVICES=0). Replace sweep_ID in the proceeding example with the W&B Sweep ID that is returned when you initialized a W&B Sweep:
Terminal 1
CUDA_VISIBLE_DEVICES to 1 (CUDA_VISIBLE_DEVICES=1). Paste the same W&B Sweep ID for the sweep_ID mentioned in the following code snippet:
Terminal 2