Hyperparameter sweeps on slurm
Project description
slurm_sweep: hyperparameter sweeps with W&B on SLURM clusters
slurm_sweep is the missing (small) piece to efficiently run hyperparameter sweeps on SLURM clusters by combining the power of weights and biases (W&B) and simple_slurm. It allows you to efficiently parallelize sweeps with job arrays, while tracking experiments and results on W&B. All you need is:
- W&B account.
config.yamlfile that defines your sweep.train.pyscript, that specifies the actual training and evaluation.
Getting started
Create an account on W&B and take a look at our examples in the examples folder. These contain both config.yaml and train.py scripts.
The config file
You need config file in yaml format. This file should have three sections:
general: you need to define at least theproject_nameand theentityfor the sweep on wandB.slurm: any valid slurm option. Depends on your cluster, see thesimple_slurmdocs.wandb: standard W&B config for a hyperparameter sweep.
The training script
This needs to be a python script that defines the training and evaluation logic. It should call wandb.init() and retrieve parameters from wandb.config. It can log values using wandb.log. See the W&B docs.
Submission
Once you're ready, you can test your config file using slurm-sweep validate-config config.yaml. If this passes, create a submission script using slurm-sweep configure-sweep config.yaml, and submit with sbatch submit.sh.
Installation
You need to have Python 3.11 or newer installed on your system. If you don't have Python installed, we recommend installing uv.
There are two alternative options to install slurm_sweep:
-
Install the latest release from PyPI:
pip install slurm_sweep
-
Install the latest development version:
pip install git+https://github.com/quadbio/slurm_sweep.git@main
Release notes
See the changelog.
Contact
If you found a bug, please use the issue tracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slurm_sweep-0.2.1.tar.gz.
File metadata
- Download URL: slurm_sweep-0.2.1.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dc60539dd38a1d5d8e4ae9c70248be9c6a7d3ac718e1982a79745085828b0ab
|
|
| MD5 |
210fe338e7157365bf30ef22bb4d5610
|
|
| BLAKE2b-256 |
bb611d98818f28f3a06d1769fd6d8f59592814defad4ad5a57a81b54e671fe2f
|
Provenance
The following attestation bundles were made for slurm_sweep-0.2.1.tar.gz:
Publisher:
release.yaml on quadbio/slurm_sweep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slurm_sweep-0.2.1.tar.gz -
Subject digest:
2dc60539dd38a1d5d8e4ae9c70248be9c6a7d3ac718e1982a79745085828b0ab - Sigstore transparency entry: 637529110
- Sigstore integration time:
-
Permalink:
quadbio/slurm_sweep@cc782a40bb43ecc9e322643cd5246a991d193ef0 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/quadbio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@cc782a40bb43ecc9e322643cd5246a991d193ef0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file slurm_sweep-0.2.1-py3-none-any.whl.
File metadata
- Download URL: slurm_sweep-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16c4427d9f665a67d8a962e813e0f1c7f503b45d192a301e3ae02ff06f62b2ef
|
|
| MD5 |
ad175c75905d73a86a8cdd6bba448a33
|
|
| BLAKE2b-256 |
eec10f355bc94f063a345340a28f4df00809f25f9ab96b31a31019cafa2fd47b
|
Provenance
The following attestation bundles were made for slurm_sweep-0.2.1-py3-none-any.whl:
Publisher:
release.yaml on quadbio/slurm_sweep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slurm_sweep-0.2.1-py3-none-any.whl -
Subject digest:
16c4427d9f665a67d8a962e813e0f1c7f503b45d192a301e3ae02ff06f62b2ef - Sigstore transparency entry: 637529121
- Sigstore integration time:
-
Permalink:
quadbio/slurm_sweep@cc782a40bb43ecc9e322643cd5246a991d193ef0 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/quadbio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@cc782a40bb43ecc9e322643cd5246a991d193ef0 -
Trigger Event:
release
-
Statement type: