A python lib to schedule deep learning tasks on available GPUs.
Project description
GPU Task Scheduler
A simple Python lib to schedule and execute deep learning tasks on available GPUs. It supports:
- Custom selection of GPUs.
- Maximum concurrency per GPU.
- Dynamic task dispatch using threading.
📦 Installation
pip install gpu_task_scheduler
🚀 Usage Example
from gpu_task_scheduler import GPUTaskScheduler
tasks = [
"python train_model.py --epochs 10",
"bash run_simulation.sh",
"python evaluate.py --model checkpoint.pth"
]
scheduler = GPUTaskScheduler(
wait_interval=10,
allowed_gpu_ids=[0, 1],
max_tasks_per_gpu=2,
min_memory=0.8
)
scheduler.run_tasks(tasks)
⚙️ Parameters
GPUTaskScheduler(wait_interval=30, allowed_gpu_ids=None, max_tasks_per_gpu=1, min_memory=0)
| Parameter | Type | Default | Description |
|---|---|---|---|
wait_interval |
int |
30 |
Number of seconds to wait before checking again if no GPU is available. |
allowed_gpu_ids |
list[int] |
None |
List of GPU indices (e.g., [0, 1]) that the scheduler is allowed to use. If None, all GPUs are considered. |
max_tasks_per_gpu |
int |
1 |
Maximum number of concurrent tasks allowed on a single GPU. Helps share GPU among multiple tasks. |
min_memory |
int or float |
0.8 |
- min_memory (int or float): Minimum free memory (in MiB or as a ratio) required on a GPU to be considered available. |
🛠️ Requirements
- Python 3.6+
nvidia-smiavailable in PATH (NVIDIA drivers installed)
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
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 gpu_task_scheduler-0.3.0.tar.gz.
File metadata
- Download URL: gpu_task_scheduler-0.3.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
455632ec7efe430c9262d5e16b2dd538edf07094842e5d3e78e049867f195624
|
|
| MD5 |
1d31b2cec1a848c137cde97098bd8fd4
|
|
| BLAKE2b-256 |
008555850e94bcfd464e38e330c20d04576502cc4fbb429803a2c8397bbbaf85
|
File details
Details for the file gpu_task_scheduler-0.3.0-py3-none-any.whl.
File metadata
- Download URL: gpu_task_scheduler-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36a1ac4470d32853a8fc0a8a6e9107330b842e93557fa92a9bd0d15bc421e465
|
|
| MD5 |
dc82d38eff87fc1e93c53ba31ec698d6
|
|
| BLAKE2b-256 |
b8f2790be82eb81bde9be7d5604b288ae930a3a277f124a674f8ff576aab3875
|