GPUs for agents on Kubernetes should sit outside Agent Substrate snapshots. GPU memory is not a file the runtime can checkpoint. If you give the actor a device, suspend either drops that state or pins the card, which is the opposite of multiplexing.
I keep the GPUs outside. Agents on the substrate pool. Model calls leave the actor. That looks like a sandbox problem. It is an inference-topology problem.
Why doesn’t GPU memory belong in the snapshot?
Agent Substrate puts idle agents to sleep and writes memory and files into a snapshot. I have watched that on a two-worker pool: actor leaves the bay, lands on the shelf, comes back on the other worker for the next turn. The snapshot is the agent. The worker is a bay.
GPU memory lives on the device. It is not in the filesystem the sandbox can serialize. On suspend you have two bad options:
- Skip the GPU state and resume a broken process.
- Leave the device allocated and throw away the density the runtime exists for.
I will not bet on a third option I have not run. gVisor will serialize some things I thought were kernel-only, like a held flock(). That did not make me reckless about sockets, and it does not make me reckless about a card. Pinned resources. Host-network sockets were never in the sandbox. Device memory is the same class of “not yours to checkpoint.”
The dataplane I actually run is CPU sandboxes and snapshot movers: ateapi, atenet, atelet, ateom talking to gVisor runsc. Agent Substrate dataplane is not a device plugin. One actor per sandbox, always. Idle agents are zstd snapshots in object storage. That contract assumes the scarce resource can be released when the actor sleeps. A GPU in the actor cannot.
What I refuse to put in a snapshot is the same list I already use for suspend: long-lived secrets, GPU memory, and open TCP the sandbox does not own. Secrets get minted at restore. GPUs stay outside. Connections drop on suspend. Suspend and resume agents.
How should the inference pool sit next to Substrate?
Agents on Substrate. Model calls leave the actor. In the laptop lab that was Ollama on the host. In anything I would call production it is an inference pool with a queue, not a GPU mounted into ateom.
That matches how I already think about tools: the actor should not own the scarce resource. It should call it. Sharing the card is a separate layer. Whatever you use to slice GPU memory, the rule is the same: one agent cannot fill the device, and the limit is on the inference side. I am not going to prescribe a slicer I have not productionized in this runtime. Measure fragmentation yourself.
The 18-agent laptop cluster was CPU and a local model. Different device, same shape: many actors, few workers, one generator. Nine agents on two workers was the published lab, reserved capacity about 4.5x lower than always-on pods. Always-on defaults were about 204 MiB and 50m CPU idle. None of those numbers are GPU numbers. They are why I will not put a card in the actor just to make the sandbox look like a training box.
Scheduling agent sandboxes does not schedule GPU slices. A resume queue decides which actor gets a worker slot. Do not pretend that policy also placed memory on the device. Schedule the inference pool as seriously as the WorkerPool.
If the agent is doing RL rollouts that are mostly waiting on a model, you wanted this split anyway. Suspend during the call only works if the actor does not hold the GPU. Scheduling sandboxes for RL.
What do I measure on a wake-up storm?
When many agents restore at once, the WorkerPool is rarely the first bottleneck. The model is.
I already had extra workers pile onto a serial generator and time out. Load came in, the pool filled, rejections showed up, the autoscaler added workers, and every turn got slower. The backend was generating one response at a time. More workers meant more agents restored, holding slots, all waiting in line at the same single generation queue. I capped load-generator concurrency to 2 against Ollama to match what that backend could serve. The autoscaler made it worse. A GPU pool with a long queue is that graph with more money on the x-axis.
Numbers I would collect before I believed a setup:
- time to first token with 1, 8, 18 agents waking together
- GPU memory high-water per slice
- reject rate on the WorkerPool vs queue depth on the generator
- whether a failed generation leaves a ghost actor (it can)
I am not going to invent those numbers here. 1, 8, and 18 are cluster sizes I have actually used as live-agent counts, not GPU results. The 18-agent laptop cluster was CPU and a local model. Different device, same stampede shape.
Ghost occupancy still applies. A generation that dies mid-flight can pin a worker while the pool looks idle. New sessions then fail with substrate worker pool has no free workers. Reset the pool. Snapshots survive. Ghost actors pin your workers. Watch the workers list, not pod CPU. kubectl is lying to you.
Scale the bottleneck, not the thing in front of it. Before you scale agent workers, know the concurrency of whatever serves the tokens: a local runtime, a GPU, or a provider rate limit. If the model is the constraint, more workers is just a more expensive waiting room. Model backend concurrency is a first-class capacity number, next to worker replicas. Agent platform at scale.
When does a GPU inside the actor still make sense?
Local GPU in the actor. Lower latency, impossible suspend, noisy neighbor on the node, snapshot story is a lie. Use it for a dedicated, always-on agent you would have run as a pod anyway. That is the agent-sandbox vs Agent Substrate fork. A handful of long-lived agents that hold a device should stay a pod per agent. You get kubectl, NetworkPolicy, and a standard HPA. You also get one reservation per agent, including the hours it is waiting. That is the right bill if you cannot park the process.
GPU outside. Suspend works, you can multiplex actors, you pay a hop, and you must schedule the inference pool as seriously as the WorkerPool. Restore is not a warm in-memory process. The first reconcile bakes a golden snapshot, about a minute in my lab. A later restore is faster and still not a local GPU call. If your SLA is “first token in 100ms and the agent was cold on a card,” Substrate is the wrong tool.
Do not pack two agents into one sandbox to share a GPU and call it density. You lose isolation and you still have one network identity. Simultaneous work still equals worker count. Sharing a device across unsandboxed processes is a noisy-neighbor problem, not Agent Substrate.
Checklist: keep inference out of the snapshot
- Give Substrate workers CPU sandboxes only. No device plugin on
ateom. - Point model calls at an inference service that owns the GPUs, with a queue you can see.
- Put a memory limit on the inference side so one agent cannot fill the card.
- On a wake-up storm, record time to first token, GPU high-water, WorkerPool rejects, and generator queue depth. Do not invent a winner from a quiet CPU graph.
- Cap useful worker count at the generator’s concurrency. Extra bays in front of one cashier make every turn slower.
- Treat a failed generation as a ghost-slot risk. Board the workers list. Reset if a bay is held with no turn.
- If you truly need a GPU in the process, run that agent as a dedicated pod or sandbox. Do not pretend it suspends.
Field guide: Agent Substrate. The laptop topology (Ollama on the host, agents in the pool) is in kagent Agent Substrate.