Skip to main content

A Python package for preemptive scheduling on NVIDIA GPUs

Project description

nVertake

A Python package for preemptive scheduling on NVIDIA GPUs.

Features

  • Priority Scheduling: Elevate your GPU process priority using CPU nice values and CUDA stream priorities
  • Memory Reservation: Reserve GPU memory to prevent other processes from claiming it
  • Dynamic Memory Management: Maintain constant memory usage even during script execution

Installation

pip install -e .

Usage

Run with Elevated Priority

Run a Python script with elevated GPU scheduling priority:

nvertake run train.py --epochs 100

Memory Reservation

Reserve 95% of GPU memory while running your script:

nvertake --filled 0.95 run train.py

This prevents other processes from claiming GPU memory, even when your script temporarily frees memory during execution.

Standalone Memory Fill

Just fill GPU memory without running a script (useful for reserving GPU):

nvertake --filled 0.95

Press Ctrl+C to release the memory.

Specify GPU Device

nvertake --device 1 --filled 0.8 run inference.py

Show GPU Info

nvertake info

CLI Options

nvertake [OPTIONS] [COMMAND]

Options:
  --filled, -f RATIO    Fill GPU memory to this ratio (0.0-1.0)
  --device, -d GPU_ID   GPU device to use (default: 0)
  --nice, -n VALUE      Nice value for CPU priority (default: -10)
  --quiet, -q           Suppress info messages
  --version, -V         Show version

Commands:
  run SCRIPT [ARGS...]  Run a Python script with elevated priority
  info                  Show GPU information

How It Works

Priority Scheduling

  1. CPU Priority: Uses os.nice() to increase process priority (lower nice value = higher priority)
  2. CUDA Streams: Creates high-priority CUDA streams for GPU task scheduling

Memory Reservation

  1. Calculates target memory based on fill ratio
  2. Allocates buffer tensors to reach target
  3. Runs a background thread to monitor and adjust buffer size
  4. Maintains constant total GPU memory usage during script execution

Requirements

  • Python >= 3.8
  • PyTorch
  • NVIDIA GPU with CUDA support
  • psutil

License

MIT

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

nvertake-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

nvertake-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file nvertake-0.1.0.tar.gz.

File metadata

  • Download URL: nvertake-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nvertake-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7606bcc4264e4478166e4f93df0fe2d1a0d16af7a129e8a8ca82967fb78ee462
MD5 500a629378ff2c748e18e79601de3022
BLAKE2b-256 92f39e14cfd6fcfcc2834d32ed3ba7c5f42168af1d82e820f523bc56ecee2e12

See more details on using hashes here.

Provenance

The following attestation bundles were made for nvertake-0.1.0.tar.gz:

Publisher: python-publish.yml on FanBB2333/nVertake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nvertake-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nvertake-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nvertake-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 696338116dffaa5ec9460fdb8643fa6fec628d4340f50866a926792f54e5e236
MD5 d79440471012c0f96cf714492f28061a
BLAKE2b-256 c7c33ce266a6a2150e684796e20c3f2284e6010340dfa5177d26dfcaa5fca76f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nvertake-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on FanBB2333/nVertake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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