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.0.tar.gz
(20.1 kB
view details)
Built Distribution
slurmify-0.1.0-py3-none-any.whl
(19.9 kB
view details)
File details
Details for the file slurmify-0.1.0.tar.gz
.
File metadata
- Download URL: slurmify-0.1.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e894d7ca7d7567fdf318e86cd7def418bc7f2363497868928f228daaff22fbf |
|
MD5 | 15545140bf7c3b18154b7b36cb1af165 |
|
BLAKE2b-256 | f1c5eba0a586f1c41c4a68b20215000c2551362067335e2e1a6cbd5eaec7cda4 |
File details
Details for the file slurmify-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: slurmify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.9 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 | 758102a9ee8664e05e716900b282c4036b128930c6cb15c4a7477fd2f89fee2f |
|
MD5 | 186396b46f2b6505635e5ca3087cdcec |
|
BLAKE2b-256 | a61e4e7d0dea7f5fae7b8538b4ba9acc72e19f6a633f0e8eac43bc4798b26ee5 |