Practical technical guides / Recent development: Berth 0.6.0 (released 14 November 2026) protected GPU training leases

Protect a Training Run on a Shared GPU: Refuse Competing Requests at Once and Keep the Lease Across Restarts

Berth 0.6.0 (14 November 2026) refuses competing requests at once while a training holds a GPU, even across restarts. A synthetic admission model compares rules.

By Sandeep Belgavi · Published 2026-11-15

A training lease refuses at once instead of draining
Original explanatory diagram; synthetic values where shown.

Berth 0.6.0 (14 November 2026) refuses competing requests at once while a training holds a GPU, even across restarts. A synthetic admission model compares rules.

A shared card and a run that cannot be interrupted

Many teams run inference and training on the same few GPUs. A workstation or a small node serves a local model for chat and agents during the day, generates images on request, and in between someone starts a fine-tune that takes hours. A scheduler in front of the card decides who holds it. For inference engines the usual policy is to drain the current holder when a request of equal or higher priority arrives, because a model can be unloaded and reloaded in seconds. For a training run that policy is ruinous: draining it loses everything since its last checkpoint, and then the run has to reload and redo that work.

Berth, an Apache-2.0 GPU lease scheduler for single nodes, released version 0.6.0 on 14 November 2026 with a berth train command aimed at exactly this. Its release notes and leasing documentation at the v0.6.0 tag describe the rules, and they make a useful general design for any team that shares cards between serving and training, whether or not you use Berth. This article explains those rules, then measures their effect with an original admission model; it does not run Berth.

What berth train promises

From the release notes and the training section of the leasing documentation:

  • A training run "takes the whole of each card it names, waits for them with no deadline, and keeps them until the command exits."
  • While it holds a card or waits for it, the scheduler "refuses every other request on that card at once": gateway requests, managed engine runs, models started through an integration, scheduled jobs and manual holds. "Clients get the refusal right away instead of waiting out their timeout."
  • A second training for the same card waits in line and starts when the first ends. Cards the training does not name keep serving.
  • berth train refuses to start when the scheduler daemon is not running, because the lock lives in the daemon.
  • A daemon restart or upgrade does not stop the run, and the lock holds while the daemon is away: with the daemon down, starting an engine is refused while a training runs. A new daemon "refuses every other request until the training re-attaches, with no time limit, where other engines get 15 seconds."
  • On Linux with an NVIDIA card, --exclusive also puts the granted cards in exclusive-process compute mode for the run's life, so a program that opens CUDA without going through the scheduler cannot open them.

The older alternative, a pinned run, is a lease that is never drained but may share its card. The documentation keeps it for "a run that must not be drained but may share its card".

Three admission rules, side by side

The interesting design choices are the refusal and the restart rule, so the companion model compares three ways to protect one card while a two-hour training runs on it:

  • Training lock. Competing requests are refused at once while the training holds the card.
  • Pinned. The training cannot be drained, but competing requests wait in line until it ends or until the client's own deadline, whichever comes first.
  • No protection. Each request drains the training, which resumes from its last checkpoint after the request is done.

The model has 40 synthetic inference requests, each needing the whole card for three minutes, arriving at random times over the training and the half hour after it, with seed 15. Clients give up after 60 seconds. At minute 50 the scheduler restarts and the training takes 40 seconds to re-attach; three clients retry every ten seconds during that window. Checkpoints are every 30 minutes.

RuleServed on the cardRefused at onceTimed out after waitingClient waitTraining lostTraining finished
training lock53800 s0 minminute 120
pinned53352,100 s in total, 48.8 s mean0 minminute 120
no protection40000 s69 min across 19 drainsminute 266.7

The lock and the pin protect the training equally. The difference is entirely on the client side. Under the pin, 35 clients each waited out most of their 60-second deadline before failing; under the lock they failed in milliseconds and could have gone elsewhere at once. Without protection every client was served immediately and the training paid for it: 19 interruptions, 69 minutes of lost work, and a finish more than two hours late. Checkpointing every five minutes instead of thirty cut the lost work to 44 minutes, and the run still finished at minute 241.7, because the inference requests themselves occupied the card.

Refusal is only useful if the client can act on it

A fast refusal is worth something only if the client has somewhere to go. With a second card available, the model sends refused and timed-out requests there: under the lock all 38 are served on the second card with no waiting, and under the pin the same 38 are served, but 35 of them only after waiting out the deadline first. If the second card is behind a gateway that retries on another node, the lock turns a long stall into a quick redirect.

Without a second card, the choice is about what failure looks like. A refusal in milliseconds lets an agent tell its user that the model is busy and offer to queue or try later. A 60-second timeout looks like a hang. And if clients have long deadlines, the pin turns into a queue: with a one-hour deadline, 14 requests waited for the training to end and were then served, 21 still timed out after a full hour, and the mean wait across all requests was about 40 minutes. That may be acceptable for batch jobs and is rarely acceptable for interactive ones.

The restart window

Scheduler restarts are where lease systems usually leak. The daemon that held the lock is gone, the training process is still running on the card, and the new daemon does not yet know about it. If the new daemon grants requests before the training re-attaches, it admits inference onto a card that is full, which at best fails to load and at worst pushes the training out of memory.

The model compares three restart rules with the same three retrying clients and a 40-second re-attach:

Restart ruleRequests admitted onto the training card during the restart
refuse until the training re-attaches, no time limit0
refuse for a fixed 15 seconds1
no grace period3

A fixed grace period is the general Berth rule for inference engines, which normally re-attach well within 15 seconds. A training process that is busy in a long step or a checkpoint may not, which is why the 0.6.0 notes give trainings an unbounded wait. The model's re-attach time is a parameter, not a measurement; the lab lets you shorten it and see the fixed grace become safe.

Limits of a cooperative lease

Every rule above applies only to requests that ask the scheduler. A process that opens the card directly, a notebook started by hand or a container with the device mapped in, is invisible to admission. Berth's documentation says this plainly for its holds: a hold "cannot free memory held by something outside Berth", which is reported as contested. The --exclusive option narrows the gap on Linux with NVIDIA cards by setting the driver's compute mode, so other CUDA processes cannot open the card at all, at the cost of a sudo rule for nvidia-smi -c and of refusing to start when another compute process is already present.

For a team adopting this design, the order of work is:

  1. Put every serving engine behind the scheduler, so admission sees all managed demand.
  2. Start trainings through the protected path, and make clients treat a refusal as a signal to try another card or tell the user.
  3. Decide the restart rule explicitly, and test it by restarting the scheduler while a training runs.
  4. Use driver-level exclusivity where available for runs whose loss would be expensive, and monitor the card for processes that hold memory without a lease.

Failure modes

Refusals without a fallback. A fast refusal with nowhere to go is still a failed request; measure how many requests fail during trainings, not only how fast.

Training that never ends. A protected training that hangs holds the card indefinitely. Berth leaves stopping it to a person; build an alert on lease age.

Checkpoint intervals tuned for the wrong failure. Frequent checkpoints reduce the cost of a drain but cost I/O and time. With a lock, drains do not happen, and the interval only needs to cover crashes.

Mistaking the model for a benchmark. The table is a deterministic simulation of admission rules with synthetic arrivals. It contains no measurement of Berth, of any GPU or of any training job.

Verification

The companion example is the admission model in Python with a browser port used by the lab; both produce identical results for nine presets. Its tests check the numbers above, that the lock and the pin never interrupt the training, that a second card serves every refused request, that the unbounded restart rule admits nothing during re-attachment while the fixed and absent grace periods admit one and three, and that invalid inputs are rejected.

Interactive experiment

Shared GPU leases: protected training, refusals and a scheduler restart. Synthetic browser-local fixtures, adjustable inputs, decision traces and JSON export.

Primary references and authorship

Sources dated on or before 15 November 2026. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/gpu_training_lease_model. Views are my own and do not represent any employer, past or present.