Skip to main content

slrun - SLURM Tools

Run commands on SLURM as if they were local, with seamless detach/reattach capabilities.

Features

  • Seamless job submission: Run commands on SLURM with minimal syntax changes
  • Real-time output streaming: See stdout/stderr as if running locally
  • Detach/reattach capability: Start a job, detach, and reconnect later
  • Job management: List all detached jobs and their statuses
  • Configuration profiles: Store different resource configurations in config file
  • Automatic cleanup: Temporary files are removed when jobs complete

Installation

Using UV (recommended)

uv add slrun

Directly from GitHub

uv pip install git+https://github.com/yashsavani/slrun.git

Using pip

pip install slrun

Quick Start

Launch a job

slrun launch python train_model.py --epochs 100

With custom SLURM resources

slrun launch --mem 128GB --time 2-00:00:00 --gres gpu:A100:2 python train_model.py

Using a configuration profile

slrun launch --profile large python train_model.py

Handling argument conflicts

When your command uses arguments that might conflict with slrun, use the -- separator:

slrun launch --timeout 7200 -- python script.py --timeout 3600

List all detached jobs

slrun list

Reattach to a job

slrun attach 12345  # Replace with your job ID

Configuration

You can customize default settings by creating a configuration file:

# Edit your configuration file
slrun config edit

# View your current configuration
slrun config show

Example configuration (~/.slrun/config.toml):

[defaults]
time = "2-00:00:00"
mem = "128GB"
gres = "gpu:A100:1"

[profiles.large]
time = "7-00:00:00"
mem = "256GB"
gres = "gpu:A100:4"

[profiles.debug]
time = "0-01:00:00"
mem = "16GB"
gres = "gpu:K80:1"

Development

Local Development Setup

# Clone the repository
git clone https://github.com/yashsavani/slrun.git
cd slurm-tools

# Install in development mode
uv pip install -e .

Building the Package

uv build

Documentation

For complete usage instructions, see the detailed documentation.

Requirements

  • Python 3.6+
  • Access to a SLURM cluster with sbatch, squeue, and sacct commands

License

MIT

Metadata

Release files for slrun 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 slrun 0.1.4
File Size Uploaded
slrun-0.1.4.tar.gz 25.0 kB Details

Built distribution (wheel)

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

Total release size: 35.9 kB

Release files / slrun-0.1.4.tar.gz

Download URL slrun-0.1.4.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a97fe9d2c865a113e0d3ee7021dcf984b7d553f9809f0b2af93a8d982137555d
BLAKE2b-256 checksum
How to use checksums
ebaebf38f124d13499c4968c9e542c8d55fe17dafec367cbff882c6699e1951a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

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

Download URL slrun-0.1.4-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70342207a23154f432fdc14ef1fe41ee9ba2593dcdc8a285a5c6f8cc5ac7f15d
BLAKE2b-256 checksum
How to use checksums
4f5c357edf6290f922c7ae0e36fd7f568095b26624c9b7b9d2f6ecaa0b023021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

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