---
title: "How we checkpoint and restore vLLM on AMD Instinct"
description: "Starting with v2.0.0-beta.19, warmctl can checkpoint and restore vLLM replicas on NVIDIA and AMD GPUs."
author: Kirill Bespalov
date: 2026-11-22
url: https://warmctl.io/blog/amd-checkpoint-restore/
---

# How we checkpoint and restore vLLM on AMD Instinct

> Starting with v2.0.0-beta.19, warmctl can checkpoint and restore vLLM replicas on NVIDIA and AMD GPUs.

Fireworks AI runs inference on AMD Instinct and NVIDIA GPUs in the same fleet. When traffic spikes, a fresh vLLM replica on either platform faces the same cold start. It has to start its workers, load the model weights and warm up its kernels. Until then, the replicas already serving have to handle the extra requests. [Fireworks AI’s inference infrastructure ↗](https://fireworks.ai/solutions/virtual-cloud-infrastructure)

With warmctl, you can do that warmup once and save the running engine. We tested the new AMD backend with Qwen3.8-27B FP8 on a single [RunPod MI350X](https://www.runpod.io/gpu-models/mi350x). With the snapshot already on the pod, our client received its first answer **9.71 seconds** after we ran `warmctl up`. [beta.19 release notes ↗](https://github.com/TensorRails/warmctl/releases/tag/v2.0.0-beta.19)

## What the CUDA driver does for us

On NVIDIA, a snapshot taken with `warmctl build` includes vLLM’s workers after they have captured execution graphs for the batch sizes they expect to serve. Saving the Linux processes preserves the runtime’s pointers and handles. The GPU driver owns the allocations and queues those references point to. A replica needs both halves to start submitting work again.

In 2024 NVIDIA documented `cuda-checkpoint` for the R550 driver. It lets submitted GPU work finish, copies device memory into host memory and releases the CUDA resources. A Linux process checkpointer can then save the application. At restore, the NVIDIA driver rebuilds the resources that the saved process expects. [NVIDIA’s driver walkthrough ↗](https://developer.nvidia.com/blog/checkpointing-cuda-applications-with-criu/)

## Why CRIU stopped at the first checkpoint query

ROCm (Radeon Open Compute Platform) is AMD’s counterpart to the CUDA stack. Beneath its CUDA-like HIP interface, the ROCr runtime asks the AMD Kernel Fusion Driver (KFD) for GPU memory and queues through `/dev/kfd`.

CRIU, the Linux checkpoint tool, ships an `amdgpu` plugin. We ran two queries on the same open device file as root in our [RunPod container](https://docs.runpod.io/pods/overview). The first asked for the driver interface version. The second asked how many devices, buffers and other resources the plugin would need to save. [CRIU plugin source ↗](https://github.com/checkpoint-restore/criu/blob/criu-dev/plugins/amdgpu/amdgpu_plugin.c#L1417-L1426)

```
KFD ioctl version 1.23
CRIU_OP PROCESS_INFO: Permission denied (errno 13 EACCES)
```

The checkpoint query requires `CAP_CHECKPOINT_RESTORE` or `CAP_SYS_ADMIN` in the host’s initial user namespace. Our pod had neither. It could still allocate GPU memory and launch kernels. [The permission check in KFD ↗](https://github.com/torvalds/linux/blob/v6.12/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c#L3096-L3107)

## How libkfdreplay puts the worker back together

ROCm had already created every buffer and queue during warmup using the permissions our pod had. Could we record how it did that and use the same driver calls on restart? We wrote **libkfdreplay**, an open-source C library that warmctl loads into each engine process with `LD_PRELOAD`. It tracks allocations, address mappings, events and queues as ROCm creates and releases them. [libkfdreplay on GitHub ↗](https://github.com/TensorRails/libkfdreplay)

At checkpoint, warmctl exports the weights and puts vLLM to sleep. The library copies the remaining GPU buffers to host memory, parks the runtime threads and releases the device files. On our single-GPU Qwen run, three of the four processes had opened GPU devices, including the API server. Once all three had let go, DMTCP could save the Linux process tree.

On restart, DMTCP brings back the worker’s CPU memory. ROCm remembers which buffers it owns and where it left off in each command queue. libkfdreplay reopens the GPU devices and asks the driver for fresh buffers and queues. For the worker to use them, its old references must still point to the right buffers, and the GPU must pick up where the worker expects to write its next command. [A standalone HIP checkpoint and restore example ↗](https://github.com/TensorRails/libkfdreplay/tree/v0.1.2/examples/hip_toy)

*Once the snapshot is written, you can stop the original worker.*

## How does the worker find its GPU buffers again?

libkfdreplay can put a buffer’s bytes back at the same GPU address. But when ROCm asks the driver to free that buffer, it identifies it by a number the driver assigned during warmup. That number, called a handle, is still in the worker’s CPU memory after a restore.

Suppose ROCm allocates scratch space for warmup, then an output buffer. The driver gives them handles 1 and 2. By checkpoint time the worker has released the scratch space. If we recreate just the output buffer, it can get handle 1. The next time ROCm tries to free the output buffer, it will ask for handle 2. The driver has no such buffer.

During replay, libkfdreplay takes handle 1 with a temporary allocation. The driver then assigns handle 2 to the output buffer, and we can release the temporary one. This explains the `27 dummies` in our Qwen restore log. Each was a 4 KiB buffer that occupied a missing handle while we recreated the worker’s 1,319 live buffers. [Buffer replay in libkfdreplay ↗](https://github.com/TensorRails/libkfdreplay/blob/v0.1.2/src/restore.c#L119-L171)

MI350X worker restore log

```
[kfdr] restore (cold): 1319 BO (27 dummies), 2330.3 MiB written,
152 events, 5 queues (fast-forward 616.90 ms) in 1.348 s
```

## An empty queue can be ten packets behind

Once the worker has its buffers back, it needs to submit its next command. ROCm writes each command packet into a slot in a ring called an AQL queue. Imagine an eight-slot ring in which the GPU has consumed all ten packets the worker submitted before the checkpoint. The worker will write its next packet in slot 2. The new hardware queue is waiting to read slot 0.

We give the GPU ten barrier packets that launch no kernels. The command processor consumes them in order, wrapping around the ring once. When its read index reaches ten, the runtime can submit the next real packet exactly where it expected. [Queue replay ↗](https://github.com/TensorRails/libkfdreplay/blob/v0.1.2/src/restore.c#L293-L337)

*The ten barriers launch no kernels. They advance the GPU’s read index to 10. In an eight-slot ring, that leaves slot 2 ready for the first inference command.*

Across the Qwen worker’s five queues, advancing those counters took **617 ms of the 1.35 s** spent restoring GPU state. That cost grows with the number of packets the worker has submitted. We bake just after warmup so each new replica has less queue history to replay.

## From warmctl up to the first answer

We baked Qwen3.8-27B FP8 with multi-token prediction on one MI350X, running vLLM 0.33, ROCm 10.0 and amdgpu 7.1.3. The bake took 288.8 seconds, including 212 seconds for a separate startup and warmup pass to prime the compilation caches. We kept the 39.65 GiB snapshot on the pod and started the clock at `warmctl up`.

*Each dot marks elapsed wall time in a single restore. Blue marks come from the warmctl log, rounded to tenths of a second. Green marks come from the external probe. Select a row for its observation.*

At 2.1 seconds all four processes were back. By 5.3 seconds the worker had reloaded and fingerprinted 29.41 GiB of weights. A known prompt matched, the gateway opened, and at **9.71 seconds** our client received “51” for 17 × 3. Two fresh vLLM launches on the same card with the compilation caches already warm took 45.9 and 46.1 seconds to pass their direct `/health` checks. [Test conditions and hardware results ↗](https://github.com/TensorRails/warmctl/pull/78#issuecomment-6957933763)

Would a restored replica give the same answers as a fresh one? Two fresh launches and two restores agreed on three prompts sent one at a time. With eight requests in flight, one restore matched the fresh runs on all 16 completions. The other differed on three. Exact repeatability under batching remains open. These hardware measurements used the libkfdreplay 0.1.2 release candidate. The final library passed a separate end-to-end restore on Linux with simulated AMD devices. [Release qualification ↗](https://github.com/TensorRails/libkfdreplay/releases/tag/v0.1.2)

## Try it on one MI350X

Use the same vLLM 0.33 ROCm runtime image for build and restore, mount the model at the same path, and expose one MI350X. DMTCP reopens files at their saved paths. [Build the runtime ↗](https://github.com/TensorRails/warmctl/blob/v2.0.0-beta.19/deploy/images/vllm-rocm-0.33/README.md#local-build)

```
$ warmctl build --profile qwen38-27b-mi350x-tp1 \
    --model-dir /models/qwen38-27b --output /snap/q27
$ warmctl up /snap/q27
```

The same two commands now work on CUDA and ROCm. Build a snapshot for each backend. The AMD preview covers one GPU per replica, including a restore to a second compatible GPU in the same physical host. Cross-host restore still needs testing. Multiple AMD ranks would also need a way to reconstruct the GPU memory they share through RCCL. [Compatibility and limits ↗](https://github.com/TensorRails/warmctl/blob/v2.0.0-beta.19/docs/amd.md#limits)
