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 PyPI Downloads

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


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.2.0.tar.gz (1.6 MB 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.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for slurm_sweep-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7712b7313b0ca2f5a9bc3c74ad096c4ee25544b9f2d7069a1f5fb57c4cb25f63
MD5 9e8fec37256eee07dbf71665df4af83e
BLAKE2b-256 c645f29ebf2ec3b86005ff8ceb651edefddf2110f1702bc65d1e0540beb87878

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurm_sweep-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: slurm_sweep-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a74c51b2480bfaaf3204513efc9593a3e25283dc6e2ca88d64f9384b9fd51f4
MD5 30bbef6e0c7ed8c559042fcc6dd8cd39
BLAKE2b-256 144bad51fd8abfa4ff0952d1acc93fc8af1e5fcdf3846b30c32a3b2634518baa

See more details on using hashes here.

Provenance

The following attestation bundles were made for slurm_sweep-0.2.0-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