Skip to main content

Hyperparameter sweeps on slurm

Project description

slurm_sweep: hyperparameter sweeps with W&B on SLURM clusters

Tests Coverage Pre-commit.ci

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.yaml file that defines your sweep.
  • train.py script, 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 the project_name and the entity for the sweep on wandB.
  • slurm: any valid slurm option. Depends on your cluster, see the simple_slurm docs.
  • 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.10 or newer installed on your system. If you don't have Python installed, we recommend installing uv.

There are several alternative options to install slurm_sweep:

  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slurm_sweep-0.1.3.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slurm_sweep-0.1.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file slurm_sweep-0.1.3.tar.gz.

File metadata

  • Download URL: slurm_sweep-0.1.3.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for slurm_sweep-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0c0b8eb36b7ba3eb9d774b90bdccab5f8949f1af10d8500fd8082eedbc44e988
MD5 7b73f74ebc386ff393baf28c4f5d1ce4
BLAKE2b-256 cd39bc88ccdb96a78b21e67ce315216c1e533ac8b5a59b659d702526252f31dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurm_sweep-0.1.3.tar.gz:

Publisher: release.yaml on quadbio/slurm_sweep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slurm_sweep-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: slurm_sweep-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for slurm_sweep-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b7357b93d18cc8f6003f380f60f7755e8aaec7e11671abed7e6f462cf7da557b
MD5 c283b60d1722123dc678aacb6aff25c6
BLAKE2b-256 420ebecf252c3adcd42d1cc59b1e8d5ab4b3df167acf141e382add007db81a5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurm_sweep-0.1.3-py3-none-any.whl:

Publisher: release.yaml on quadbio/slurm_sweep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page