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
- CPU Priority: Uses
os.nice()to increase process priority (lower nice value = higher priority) - CUDA Streams: Creates high-priority CUDA streams for GPU task scheduling
Memory Reservation
- Calculates target memory based on fill ratio
- Allocates buffer tensors to reach target
- Runs a background thread to monitor and adjust buffer size
- Maintains constant total GPU memory usage during script execution
Requirements
- Python >= 3.8
- PyTorch
- NVIDIA GPU with CUDA support
- psutil
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7606bcc4264e4478166e4f93df0fe2d1a0d16af7a129e8a8ca82967fb78ee462
|
|
| MD5 |
500a629378ff2c748e18e79601de3022
|
|
| BLAKE2b-256 |
92f39e14cfd6fcfcc2834d32ed3ba7c5f42168af1d82e820f523bc56ecee2e12
|
Provenance
The following attestation bundles were made for nvertake-0.1.0.tar.gz:
Publisher:
python-publish.yml on FanBB2333/nVertake
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nvertake-0.1.0.tar.gz -
Subject digest:
7606bcc4264e4478166e4f93df0fe2d1a0d16af7a129e8a8ca82967fb78ee462 - Sigstore transparency entry: 774083292
- Sigstore integration time:
-
Permalink:
FanBB2333/nVertake@f5e9db589e6ade299731f1eade40753b068101fd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FanBB2333
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f5e9db589e6ade299731f1eade40753b068101fd -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
696338116dffaa5ec9460fdb8643fa6fec628d4340f50866a926792f54e5e236
|
|
| MD5 |
d79440471012c0f96cf714492f28061a
|
|
| BLAKE2b-256 |
c7c33ce266a6a2150e684796e20c3f2284e6010340dfa5177d26dfcaa5fca76f
|
Provenance
The following attestation bundles were made for nvertake-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on FanBB2333/nVertake
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nvertake-0.1.0-py3-none-any.whl -
Subject digest:
696338116dffaa5ec9460fdb8643fa6fec628d4340f50866a926792f54e5e236 - Sigstore transparency entry: 774083295
- Sigstore integration time:
-
Permalink:
FanBB2333/nVertake@f5e9db589e6ade299731f1eade40753b068101fd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FanBB2333
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f5e9db589e6ade299731f1eade40753b068101fd -
Trigger Event:
push
-
Statement type: