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
-
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.
-
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.4.tar.gz
(21.0 kB
view details)
Built Distribution
slurmify-0.1.4-py3-none-any.whl
(20.8 kB
view details)
File details
Details for the file slurmify-0.1.4.tar.gz
.
File metadata
- Download URL: slurmify-0.1.4.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d73f4af7595ceeb4de1c6bfc431be13df826fe329094e5b61fc45cf062eb382b |
|
MD5 | 929ffcd741bfbc88f87cd8d0d1b4fc62 |
|
BLAKE2b-256 | c5dd5605afb8f035fb0d10c097c5664185729784faeea4597d8c9a00b2eec0d4 |
File details
Details for the file slurmify-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: slurmify-0.1.4-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb9c187a407f03c7c2a12830c5672b9a1f7854f3c3212430726dce19cce2047 |
|
MD5 | ebdf5e0957dd9b71b9cf41fed4ba6587 |
|
BLAKE2b-256 | 50fb2e2dd690306fb02352593df00c9909ac337df02dea7323ce717a2d1d6545 |