Skip to main content

Torch Submit

Introduction

Torch Submit is a lightweight, easy-to-use tool for running distributed PyTorch jobs across multiple machines. It's designed for researchers and developers who:

  • Have access to a bunch of machines with IP addresses
  • Want to run distributed PyTorch jobs without the hassle
  • Don't have the time, energy, or patience to set up complex cluster management systems like SLURM or Kubernetes

Under the hood, Torch Submit uses Fabric to copy your working directory to the remote addresses and TorchRun to execute the command.

It's encouraged to read torch_submit/executor.py to understand how jobs are created and scheduled.

Features

  • Simple cluster configuration: Just add your machines' IP addresses
  • Easy job submission: Run your PyTorch jobs with a single command
  • Job management: Submit, stop, restart, and monitor your jobs
  • Log tailing: Easily view the logs of your running jobs
  • Optuna Integration for parallel hyperparameter optimization

Installation

pip install torch-submit

or from source:

pip install -e . --prefix ~/.local

Quick Start

  1. Set up a cluster:

    torch-submit cluster create
    

    Follow the interactive prompts to add your machines.

  2. Submit a job:

    torch-submit job submit --cluster my_cluster -- <entrypoint>
    # for example:
    # torch-submit job submit --cluster my_cluster -- python train.py
    # torch-submit job submit --cluster my_cluster -- python -m main.train
    
  3. List running jobs:

    torch-submit job list
    
  4. Tail logs:

    torch-submit logs tail <job_id>
    
  5. Stop a job:

    torch-submit job stop <job_id>
    
  6. Restart a stopped job:

    torch-submit job restart <job_id>
    

Usage

Cluster Management

  • Create a cluster: torch-submit cluster create
  • List clusters: torch-submit cluster list
  • Remove a cluster: torch-submit cluster remove <cluster_name>

Job Management

  • Submit a job: torch-submit job submit --cluster my_cluster -- <entrypoint>
  • List jobs: torch-submit job list
  • Stop a job: torch-submit job stop <job_id>
  • Restart a job: torch-submit job restart <job_id>

Log Management

  • Tail logs: torch-submit job logs <job_id>

Optuna

The Optuna exectuor requires setting a database connection. This can be done via torch-submit db create. This will create a new database within the specified connection called torch_submit. This database should be accessible to all machines in a cluster. Study name and storage info will be accessible to to the job via "OPTUNA_STUDY_NAME" and "OPTUNA_STORAGE" environment variables.

Configuration

Torch Submit stores cluster configurations in ~/.cache/torch-submit/config.yaml. You can manually edit this file if needed, but it's recommended to use the CLI commands for cluster management.

Requirements

  • Python 3.7+
  • PyTorch (for your actual jobs)
  • SSH access to all machines in your cluster

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

Torch Submit is released under the MIT License. See the LICENSE file for more details.

Support

If you encounter any issues or have questions, please file an issue on our GitHub Issues page.

Happy distributed training!

Metadata

Release files for torch-submit 0.1.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-submit 0.1.24
File Size Uploaded Provenance Actions
torch_submit-0.1.24.tar.gz 34.1 kB Without provenance Details for torch_submit-0.1.24.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torch-submit 0.1.24
File Interpreter ABI Platform Actions
torch_submit-0.1.24-py3-none-any.whl Python 3 none any Details for torch_submit-0.1.24-py3-none-any.whl

Total release size: 59.9 kB

Release files / torch_submit-0.1.24.tar.gz

Download URL torch_submit-0.1.24.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6a35831e7caffcd0587cf7177c37d17ec50c2b2ff22f34813331fd857b95b7d9
BLAKE2b-256 checksum
How to use checksums
d2e221499736fa2f58244d2b9c4f4b6003b1e381f96f7971230faf30bee7ee51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / torch_submit-0.1.24-py3-none-any.whl

Download URL torch_submit-0.1.24-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b070a8dd122584b3c417e14eca088d088a52f5e4805a3b07bc26d267d6f58bf4
BLAKE2b-256 checksum
How to use checksums
5b1737160fca3289ba24b09c8d090a661008a99445c88e6a8e18b42ee96c93a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Security for torch-submit 0.1.24

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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