Skip to main content

pinka 拼卡

Pack GPU jobs onto shared cards by the memory they actually use.

PyPI Python CI License: MIT Dependencies: none

Left: a whole-card queue gives each GPU one job and leaves most VRAM idle while jobs wait. Right: pinka takes jobs off a spool, books each at its measured peak instead of its declaration, and stacks several jobs per GPU until the queue is empty.

Most single-machine schedulers hand out whole GPUs, so a job that needs 9 GB holds an 80 GB card while others wait. pinka is a job pool for one machine that books each job at the VRAM it really uses and stacks as many as fit on each card. The name is Mandarin pīn kǎ (拼卡): sharing a card, the way people share a taxi.

  • Measured booking. A job starts at its declared VRAM; once it has run a while, or its name has a history, it is booked at its measured peak, and the space it frees goes to the next job.
  • Chains and retries. --after dependencies, --tries, requeue on CUDA out-of-memory. Every job ends with a DONE or ERROR marker that any script can wait on.
  • Guards. A job far above its declaration is stopped and requeued before it takes a neighbour down; host RAM is admitted and guarded too.
  • Nothing to set up. No root, no database (the state is a folder of JSON files), Python standard library only.

pinka is a slimmed port of a private pool that ran about 53,000 jobs a month on a shared multi-GPU box.

Install

pip install pinka            # or: uv tool install pinka
pip install 'pinka[nvml]'    # optional: read the cards through NVML instead of nvidia-smi

GPU jobs need Linux and NVIDIA drivers; elsewhere pinka runs CPU-only jobs.

Quickstart

pinka daemon &                                     # the dispatcher; keep it running (tmux, systemd user unit)
A=$(pinka submit --name eval-1 --vram 6 -- python eval.py --shard 1)
B=$(pinka submit --name eval-2 --vram 6 -- python eval.py --shard 2)
pinka submit --name report --vram 0 --after $A,$B -- python report.py
pinka status                                       # per card: used, booked, free; which jobs run where
pinka wait $A $B                                   # block until both end; exit 0 if all are done

--vram is the peak VRAM in GB; --vram 0 makes a CPU-only job.

Why not X

Tool Why it does not fit this case
task-spooler (ts -G), simple_gpu_scheduler each job gets whole free cards
pueue a fine queue, but it does not know about GPUs
Ray (num_gpus=0.25) fractions are set by hand and never measured; a large dependency
Slurm GRES shards needs root and cluster setup

If each of your jobs needs a whole GPU, task-spooler or pueue is the simpler choice.

Learn more

Every command, the booking and guard rules, the state layout, hooks and configuration are in AGENTS.md. It is written for people and coding agents alike: point your AI at it.

Licence

MIT (LICENSE). Copyright (c) 2026 Gao Chengzhi.

Metadata

Release files for pinka 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinka 0.1.0
File Size Uploaded Provenance Actions
pinka-0.1.0.tar.gz 44.4 kB Without provenance Details for pinka-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pinka 0.1.0
File Interpreter ABI Platform Actions
pinka-0.1.0-py3-none-any.whl Python 3 none any Details for pinka-0.1.0-py3-none-any.whl

Total release size: 85.0 kB

Release files / pinka-0.1.0.tar.gz

Download URL pinka-0.1.0.tar.gz
Size 44.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cbdfa86e63dfc2f5b4d46a96fe6b58541a9554a22bbe55466d8e9c40be73f33c
BLAKE2b-256 checksum
How to use checksums
2ec3aae30afd79bdd20deaedc6df45d5225c7c9d106dd651ebdccec84c6a27a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / pinka-0.1.0-py3-none-any.whl

Download URL pinka-0.1.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6b7e5c3bac3337e3439d9c245d8fa2026fb63a4ddae7cb6882e986969ae124d
BLAKE2b-256 checksum
How to use checksums
f037cfe4f9da4ee636323c2ca6ce5cfa73a9e7544cad391996752ebaad3e4696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for pinka 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page