Repository navigation
feat: share a GPU across jobs by declared VRAM with a live free-VRAM check - #184
Merged
Merged
Conversation
…AM (#180) Specify shared-GPU admission (owner decisions 2026-11-29): - vram-gb-<N>/vram-gb-all labels, no label holds the whole GPU - per-GPU budget floor(total*(1-reserve)), reserve default and floor 20 - live free VRAM must keep the reserve; pick the lowest-index GPU that fits - charge after the worker slot and ctx check, release on every failure path - fail-safe on probe error: whole GPU, one job per GPU, last known GPUs - pin via RUNNER_GPU -> NVIDIA_VISIBLE_DEVICES and filtered /dev/nvidia<N> - gpu-probe.sh line format; GPU peak VRAM, index and declaration in the ledger - sample gpu type moves to mode: vram with the vram-gb-* labels
…ak VRAM (#180) A gpu type with concurrency mode vram admits each job on the lowest-index GPU where its vram-gb-<N> declaration (none = the whole GPU) fits the per-GPU budget and the live free VRAM keeps the reserve (default and minimum 20). VRAM is charged after the slot and ctx check and released on every exit path. The job is pinned to that GPU via its /dev/nvidia<N> node and NVIDIA_VISIBLE_DEVICES, a failing probe falls back to one whole-GPU job per GPU, and the ledger records the GPU's peak used VRAM. Adds ADR-0007.
…oor (#180) coreBudget, memBudget and vramBudget now share reserveBudget and a named floatSlack, and validateConcurrency reads Concurrency.reserveFloor; no behaviour change.
- Pick the GPU and run the live reserve check after the worker slot is acquired, so dispatch never uses a reading taken before a slot wait. - An unpinned fail-safe job now holds the whole host until it exits, even if the GPU probe recovers mid-job; snapshots report zero then. - Filter /dev/nvidia<N> by the nvidia-smi minor number (gpu-probe.sh now reports it), not the index, and handle host:container mappings; NVIDIA_VISIBLE_DEVICES keeps the index. - Probe parsing rejects duplicate index/minor and out-of-range memory readings; probe and sampler nvidia-smi calls are time-bounded. - vram-gb-* accepts only 1,2,4,8,16,32,64,128,all; other values fall back to whole-GPU. An explicit vram reserve is clamped to the floor. - The peak sampler exits when provision-job.sh dies (no orphan loop), is stopped in the EXIT trap, and a sampler failure never fails the job. The ledger records vram_charged_gb and vram_peak_scope (whole_gpu, or unavailable for an unpinned fallback job). - The cpu budget code is restored to main verbatim (no cpu change). - Capacity snapshots also respect free worker slots. - Docs (ADR-0007, deploy/README.md, listener/README.md, CHANGELOG) and the sample types aligned with the behaviour above. - Test stub resolves the real mktemp path instead of /usr/bin/mktemp.
Member
Author
Red evidence (backfilled)Stage 1, To check the Go tests apart from the missing API, the workflow built a scratch copy of the package with empty stand-ins for the new names. In that copy only the new or updated tests failed, and the rest of the suite, including all cpu tests, passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GPU jobs can now share one GPU by declaring VRAM with a
vram-gb-<N>/vram-gb-allruns-on label. The listener admits a job onto a GPU only when declared VRAM fits the per-GPU budget and live free VRAM still covers the reserve, pins the job to that GPU, and records peak VRAM in the job history ledger.Motivation
Today a gpu job holds a whole GPU, so small jobs waste most of the VRAM and other users' workloads (for example Isaac training) are not accounted for. Declared VRAM gives a budget; a live nvidia-smi check protects processes the listener did not start; recorded peaks let repos pick N from data (#104, #80).
Changes
vram-gb-<N>/vram-gb-alllabels (1..128 or all, case-insensitive, largest wins, N above budget = whole GPU); no label = whole GPU as before.floor(vram_total_gib * (1 - reserve)), gpu reserve default 20, upward-only.Test plan
Notes
Stage commits:
Known limits: nothing caps VRAM (no MIG on RTX 5090 / RTX 2000 Ada; MPS/HAMi cap CUDA only, Isaac/Kit render via Vulkan), shared compute slows jobs, Isaac needs
pid: host(#80). Refs #104, #80.Closes #180
Rebased onto the rewritten main (replaces #183, which was based on the old history).
just checkpasses; Go coverage is 95.2%.