Skip to main content

🚀 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! 🏆

Release files for slurmify 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slurmify 0.1.4
File Size Uploaded
slurmify-0.1.4.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slurmify 0.1.4
File Interpreter ABI Platform
slurmify-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 41.8 kB

Release files / slurmify-0.1.4.tar.gz

Download URL slurmify-0.1.4.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d73f4af7595ceeb4de1c6bfc431be13df826fe329094e5b61fc45cf062eb382b
BLAKE2b-256 checksum
How to use checksums
c5dd5605afb8f035fb0d10c097c5664185729784faeea4597d8c9a00b2eec0d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Release files / slurmify-0.1.4-py3-none-any.whl

Download URL slurmify-0.1.4-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfb9c187a407f03c7c2a12830c5672b9a1f7854f3c3212430726dce19cce2047
BLAKE2b-256 checksum
How to use checksums
50fb2e2dd690306fb02352593df00c9909ac337df02dea7323ce717a2d1d6545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page