Skip to main content

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
)
scheduler.run_tasks(tasks)

⚙️ Parameters

GPUTaskScheduler(wait_interval=30, allowed_gpu_ids=None, max_tasks_per_gpu=1)

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 0 Minimum free memory (in MiB) required on a GPU to be considered available.

🛠️ Requirements

  • Python 3.6+
  • nvidia-smi available 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

gpu_task_scheduler-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

gpu_task_scheduler-0.2.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file gpu_task_scheduler-0.2.0.tar.gz.

File metadata

  • Download URL: gpu_task_scheduler-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gpu_task_scheduler-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c25d75695ed8eda0e2e146c148da869f7a37511a84a58d7fc5f264bccca0ef0f
MD5 a251f1dcbb0ecbfbdb0b399c003ef833
BLAKE2b-256 acb383b0b4149ffacf9bcbb7c225ac2914c231e9e0fc962b9e502215ef65e315

See more details on using hashes here.

File details

Details for the file gpu_task_scheduler-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gpu_task_scheduler-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb665b57df4dd96b509b72b3ac8dcaab658225814be0d805d4902ccd33882eee
MD5 9ca3d633d2661d90fcaa37a9a8104eab
BLAKE2b-256 de28aaa9dbae9642903cbf8370c67fdb923e4dfa20d4aeef3d071c8a950ac6e2

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