Skip to main content

CLI tool for GPU/Slurm job notifications with automatic log and artifact delivery

Project description

GPUAlert Banner

CI PyPI Python License: MIT

Logo GPUAlert

A CLI for long-running GPU and Slurm jobs that emails you when they finish - with the full stdout/stderr logs and any output artifacts attached.

pip install gpualert
gpualert config --init
gpualert run -- python train.py

Why

You've kicked off training, it'll take twelve hours, and you want to know whether it crashed at hour two or finished cleanly at hour eleven. SSH'ing back in to find out is a tax. GPUAlert wraps the job, writes structured logs to disk, classifies common failure modes (CUDA OOM, NCCL, NaN loss, OOMKiller, etc.), and emails you the result with logs attached.

GPUAlert Demo

Features

  • Wraps any command and emails on completion: success, failure, timeout, or Ctrl+C.
  • Polls Slurm jobs via sacct so you can monitor jobs you already submitted with sbatch.
  • Writes log files to disk before the process starts, so they exist even on segfault.
  • Always attaches logs to failure emails. Non-negotiable.
  • Auto-detects ML metrics in successful runs (accuracy, loss, F1, mAP, ...) and surfaces them in the email body.
  • Scans the working directory for output artifacts after the job ends; budgets the email and zips the overflow.
  • --dry-run prints the email it would send without touching SMTP - useful for debugging.

Quick start

Install and configure:

pip install gpualert
gpualert config --init     # interactive SMTP wizard
gpualert test-email        # verify it actually works

For Gmail, generate an App Password at https://myaccount.google.com/apppasswords (requires 2FA on the account). Paste it at the password prompt.

Wrap a local job:

gpualert run -- python train.py --epochs 50
gpualert run --timeout 7200 -- bash train.sh
gpualert run --dry-run -- python smoke.py

Monitor a Slurm job you've already submitted:

gpualert slurm 12345
gpualert slurm 12345 --interval 30 --timeout 86400

List recent log directories:

gpualert logs --last 20

Uninstall — always run this before pip uninstall gpualert, otherwise your OS keyring entry and ~/.gpualert/secret.enc will be orphaned:

gpualert uninstall            # prompts; use --yes for scripted teardown
pip uninstall gpualert

Headless / CI nodes without an OS keyring can bypass the on-disk secret file by setting GPUALERT_EMAIL_PASSWORD in the environment — the resolver picks it up first, before keyring and the encrypted file.

Configuration

Stored at ~/.gpualert/config.toml (mode 600), created on first run.

[smtp]
server = "smtp.gmail.com"
port = 587
use_tls = true
username = "you@gmail.com"
password = "your-app-password"

[email]
to_addresses = ["you@gmail.com"]
attach_logs_on_success = true

[artifacts]
patterns = ["*.csv", "*.png", "*.json", "*.log", "*.npz"]
max_single_file_mb = 25
max_total_mb = 45

Full reference: docs/configuration.md.

Documentation

Community

GPUAlert is built in the open. If you find it useful, run into a bug, or have an idea, here's how to get involved:

  • Star the repo if you'd like more updates - it helps other ML researchers find the project.
  • Questions, ideas, war stories? Open a thread in GitHub Discussions. Anything from "does this work with X scheduler" to "I wrote a notifier for Y" - happy to hear it.
  • Bug reports go to Issues. The template asks for gpualert version, your OS, and the relevant combined.log lines so triage is fast.
  • Feature requests also live in Issues. Tell me what's painful in your current workflow and what would make it less painful.
  • Pull requests welcome. Contributing has the dev setup. Small fixes (typos, docs, error messages) - open a PR directly. Larger changes - open an issue first so we can agree on the shape before code happens.

Looking for collaborators on: a Slack / Discord / Telegram notifier backend, multi-job dashboards, and a Prometheus exporter for cluster-wide stats. If any of those scratch your itch, say so in a Discussion thread.

Requirements

  • Python 3.10+
  • Linux or macOS
  • An SMTP account you can authenticate to

License

MIT. See LICENSE.

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

gpualert-0.1.5.tar.gz (65.0 kB view details)

Uploaded Source

Built Distribution

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

gpualert-0.1.5-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file gpualert-0.1.5.tar.gz.

File metadata

  • Download URL: gpualert-0.1.5.tar.gz
  • Upload date:
  • Size: 65.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for gpualert-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fde4d0ca8fde6c002c2e6cae6c3cd97d58978eb60328108f5790bf9bf4c83e62
MD5 d04b9cb4a8032676865b679d4fbdf533
BLAKE2b-256 6a1fb35e854fbcc6fd8e72d5a361aa61b34a1b0dbf0f5d804ccfdcda934a39ee

See more details on using hashes here.

File details

Details for the file gpualert-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: gpualert-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for gpualert-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 270122277eb5cf973900d6680f6aad1a7da70d509ae6eabec0fef79fcd39142a
MD5 83317c166cc31dee2bc7ac03857a9f3f
BLAKE2b-256 56d74f7b70d92fd42a11b740af893e9665ccec62241abf919047dc1cf4b4ad86

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