🚀 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! 🏆
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)
| File | Size | Uploaded | |
|---|---|---|---|
| slurmify-0.1.4.tar.gz | 21.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|