Skip to main content

A Python library for simplified job scheduling and management on SLURM clusters

Project description

EasySubmit

A Python library for simplified job scheduling and management on SLURM clusters.

Python Version License: MIT

Overview

EasySubmit is a Python-based job scheduling and management system designed to seamlessly integrate with SLURM, a popular cluster management and job scheduling platform. This project aims to simplify the process of submitting, monitoring, and managing jobs on cluster environments through an intuitive Python API.

Key Features

  • Simple API: Easy-to-use Python interface for SLURM job submission
  • Task Management: Define and configure tasks with type-safe configuration classes
  • Batch Scheduling: Submit multiple experiments or jobs with different parameters
  • Profiling Support: Optional integration with Scalene for performance profiling
  • Flexible Configuration: Comprehensive SLURM configuration options
  • Type Safety: Built with modern Python type hints for better development experience

Installation

From PyPI (Recommended)

pip install easysubmit

From Source

# Clone the repository
git clone https://github.com/ysenarath/easysubmit.git
cd easysubmit

# Install in development mode
pip install -e .

Optional Dependencies

For profiling support:

pip install easysubmit[scalene]

Quick Start

Here's a simple example of how to use EasySubmit:

from easysubmit import SLURMCluster, SLURMConfig, Task, TaskConfig
from easysubmit.base import schedule

# Define your task configuration
class ExperimentConfig(TaskConfig):
    name: str = "MyExperiment"
    learning_rate: float = 0.001
    batch_size: int = 32

# Define your task
class Experiment(Task):
    config: ExperimentConfig
    
    def run(self):
        print(f"Running experiment with lr={self.config.learning_rate}")
        # Your experiment code here

# Configure SLURM settings
config = SLURMConfig(
    partition="gpu",
    nodes=1,
    ntasks_per_node=1,
    gres="gpu:1",
    mem="16G"
)

# Create cluster and schedule jobs
cluster = SLURMCluster(config)
experiments = [
    {"name": "MyExperiment", "learning_rate": 0.001, "batch_size": 32},
    {"name": "MyExperiment", "learning_rate": 0.01, "batch_size": 64},
]

schedule(cluster, experiments)

Core Components

Task and TaskConfig

  • TaskConfig: Define configuration parameters for your tasks with type safety
  • Task: Base class for implementing your computational tasks

SLURM Integration

  • SLURMCluster: Interface to SLURM cluster management
  • SLURMConfig: Comprehensive SLURM job configuration options

Job Management

  • Job: Represents individual jobs in the cluster
  • AutoTask: Advanced task automation features

Prerequisites

  • Python 3.9 or higher
  • Access to a SLURM cluster environment
  • SLURM commands (sbatch, squeue, etc.) available in PATH

Examples

Check out the examples/ directory for more comprehensive usage examples:

  • examples/slurm_scheduler.py: Basic SLURM job scheduling
  • examples/slurm_scheduler_with_profile.py: Job scheduling with profiling
  • examples/tasks.py: Task definition examples

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

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

easysubmit-0.2.1.tar.gz (69.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easysubmit-0.2.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file easysubmit-0.2.1.tar.gz.

File metadata

  • Download URL: easysubmit-0.2.1.tar.gz
  • Upload date:
  • Size: 69.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for easysubmit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 22cf8450a8b06ab68705cda346e1d9748bf91290723fe56760e3c78c4a587cf1
MD5 7cffc81ca2fa33098814eb7057913437
BLAKE2b-256 de9215e85b382477425c7655e0e20c729ce074c882617a7eb9fb93fd3112e42c

See more details on using hashes here.

File details

Details for the file easysubmit-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: easysubmit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for easysubmit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85a29e42a4283d2e91a8070889c04427feabbdf064f1080187b72b9694054639
MD5 97583d4279cd2add799aecbc59d7f11f
BLAKE2b-256 004f1d580923bb38c01a0b84fd849f2b9415c55624cdc305c899b1cec60dccd0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page