Skip to main content

A utility library for SLURM job management

Project description

🚀 slurmify: A Python Library to ease your SLURM Workflow! 🚀

Welcome to slurmify, a python library for managing SLURM jobs with style and efficiency! 🎉

🌟 Features

  • 📊 Submit parametric array jobs with ease
  • 🔄 Automatic job resubmission
  • 📝 Simplified CLI for common SLURM tasks

🛠 Installation

pip install slurmify

🚀 Quick Start

Here's a taste of what SLURM Utils can do:

slurmify submit-parametric-array \
  --job-name awesome_experiment \
  --script-path examples/run_experiment.py \
  --time-limit 01:00:00 \
  --parameter "learning_rate:0.001,0.01,0.1" \
  --parameter "batch_size:32,64,128" \
  --partition "gpu" \
  --nodes=1

📚 How It Works

  1. Create your Python script (run_experiment.py) with two essential functions:

    • setup(): Prepare your environment. This should be a function that returns a string with the setup commands.
    • run(): Define your experiment logic. This should be a function that returns a string with the command to run your experiment.
  2. smurmify takes care of the rest! It creates a parametric array job, manages submissions, and handles resubmissions if needed.

🎭 Example Script

Here's a simple template for your run_experiment.py:

import os

def setup():
    setup_cmd = """
    source ~/.bashrc
    conda activate myenv
    module load cuda/11.3
    """
    print(setup_cmd)
    return setup_cmd

def run():
    learning_rate = float(os.environ["LEARNING_RATE"])
    batch_size = int(os.environ["BATCH_SIZE"])
    
    cmd = f"python train.py --lr {learning_rate} --batch-size {batch_size}"
    print(cmd)
    return cmd

if __name__ == "__main__":
    run()

🎉 Happy SLURMing!

Now go forth and conquer those clusters! 🏆

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

slurmify-0.1.2.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

slurmify-0.1.2-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file slurmify-0.1.2.tar.gz.

File metadata

  • Download URL: slurmify-0.1.2.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for slurmify-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9ce77e0c80cc30f8d2f9d8f74af332ad5b189e040414e7b26b96f936b1da59e7
MD5 f43d3414cff2a5e3a7e5ba7102708617
BLAKE2b-256 f63195d6340563613a8dbc14dbf3a0ac5ec361307708a6b94fddb2a8002436ee

See more details on using hashes here.

File details

Details for the file slurmify-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: slurmify-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for slurmify-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3dc3157ff4775614c4ee604715acf922cbf750a344014bba959862aaf86cdfac
MD5 eccf03846b4811b10aa67b2614029243
BLAKE2b-256 a3202ba1f5d33c51b2fab7b247d4dd3ae20d32d6d3c166d7c9b11da4cf211dbd

See more details on using hashes here.

Supported by

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