Skip to content

AMD Instinct support (preview): libkfdreplay + DMTCP, vendor chosen automatically - #78

Merged
kbespalov merged 28 commits into
mainfrom
amd-rocm-backend
Nov 17, 2026
Merged

kbespalov merged 28 commits into
mainfrom
amd-rocm-backend

Conversation

@kbespalov

@kbespalov kbespalov commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

warmctl snapshots and restores a warmed vLLM engine on AMD Instinct GPUs (preview), in an unprivileged container, and nothing changes for NVIDIA users. Part of #77; design and measurements are in the comments there. See docs/amd.md.

There is no cuda-checkpoint for AMD, and CRIU's amdgpu plugin needs privileges no ordinary container has. Instead the engine's processes preload libkfdreplay (v0.1.2, pinned by SHA-256 like the DMTCP fork). Each worker checkpoints and restores its own GPU state when warmctl asks through /collective_rpc, and DMTCP snapshots the process tree as it already does for NVIDIA. Everything else is shared with the NVIDIA path: weights export and reload with fingerprints, the canary, the trees, OCI distribution and the gateway.

No user choice, no new flag

  • build takes the vendor from the host. AMD only where no NVIDIA device exists and /dev/kfd lists GPUs this process can read; NVIDIA everywhere else, as before.
    • On an AMD host it bakes in place under DMTCP. This is implied in the ROCm runtime image.
    • It lays profiles/_defaults-rocm.yaml over the defaults.
  • up takes the vendor from the snapshot. An AMD snapshot is refused on an NVIDIA host, and vice versa, before anything is pulled.
  • AMD snapshots use the manifest schema warmctl.snapshot/v2-rocm. Earlier releases refuse it, so in a repository that holds both vendors they keep choosing the NVIDIA entry instead of picking one they cannot restore. A test shows the failure the plain v2 schema would cause.

Where it plugs in

  • host.Session: a KFD-sysfs implementation, picked in openSession only where NVML cannot be opened and the host is AMD. catalog, pull, mirror, doctor, hardware and restore's host checks work unchanged.
  • internal/rocm: support matrix (gfx950, amdgpu 7.1.3), launch checks, host compatibility, the agent's /proc checks, and State, which drives the workers' RPCs.
  • internal/accel: the host's vendor, plus a GPUState hook at checkpoint and wake. For NVIDIA it is None, a no-op.
  • Agent:
    • puts libkfdreplay in the engine's LD_PRELOAD;
    • after the checkpoint, checks that no process still holds an AMD device and that every ROCm process preloads libkfdreplay;
    • refuses a bake whose engine maps a file the snapshot does not carry, and names the file.
  • Python adapter: warmctl_gpu_checkpoint/restore/state, with state and version checks and libkfdreplay's refusal reasons; HIP names for the pipelined reload.
  • deploy/rocm/Dockerfile: the ROCm runtime image on rocm/vllm (vLLM 0.29, ROCm 10.1).

NVIDIA stays byte for byte

The first commit pins today's behaviour before anything else changes:

  • two published manifests (DMTCP on H200, CRIU with cuInterpose on 8×B300) read and write back identically;
  • every shipped profile resolves identically, NVIDIA hardware rows included;
  • every command's --help is unchanged.

All new manifest fields are omitempty. The one visible difference: new bakes carry an adapter with another SHA-256, because it now contains the AMD methods, which an NVIDIA engine never calls.

Diff size: 113 files, +5,606 / −49. Fixtures and goldens under internal/**/testdata/ are marked linguist-generated, so GitHub collapses them. The H200 DMTCP golden manifest is trimmed to 786 lines: 3 allocations, the 2 parts they use, and 2 files per role, with neutral ids. Its golden SHA-256 is computed with main's code.

Test plan

  • go vet, go test -race ./... on Linux and macOS; golangci-lint v2.14.0 (./... and tests/... with criu,e2e tags); ruff; pytest on Python 3.9 and 3.12.
  • Each commit builds and passes go test ./... on its own (the first six; later commits are fixes found on the GPU).
  • make criu-test and make e2e-test on this branch (NVIDIA path with fake NVML: CRIU, Docker receiver, pod image, push/pull): pass.
  • New make amd-e2e-test (also in CI), 9/9 pass. It runs unprivileged containers with the real warmctl, DMTCP v5.0.0-warmctl.2 and libkfdreplay v0.1.0 from its release, on a KFD topology of MI350X GPUs, with the stand-in vLLM running the real Python adapter. It covers:
    • doctor;
    • a bake on an AMD host, with in-place implied;
    • the AMD manifest;
    • a restore on the donor's GPU and on another GPU (different gpu_id and render node), with the same answer on both;
    • refusals: another GPU while two are visible, libkfdreplay touched, two GPUs per engine.
  • ROCm runtime image built on the real rocm/vllm 0.29 base. Inside it:
    • vLLM 0.29's own parser accepts both AMD profiles' argv. This is how we found that --enable-nccl-comm-suspend, absent from vLLM 0.29, must be dropped on AMD.
    • A DMTCP cold cycle passes for a process with TheRock torch, vLLM and the adapter imported and libkfdreplay preloaded: checkpoint, the source exits, restart, kfdr_restore.
  • GPU acceptance on MI350X (RunPod, unprivileged containers, ROCm 10.1 TheRock, vLLM 0.29, amdgpu 7.1.3), branch at 4fc8309:
    • warmctl doctor on the pod: every check ok; the GPU is found from the KFD topology (real sysfs matched the fixture's device ID; VRAM corrected to 294896 MiB).
    • warmctl build Qwen3-0.6B and Qwen3-8B. Nothing extra was passed: AMD was detected, the bake ran in place, and the ROCm layer was applied. Each bake did the compile cache pass, warmup, canary, warmctl's own file export of the weights (1.46 / 15.28 GiB), sleep, the workers' libkfdreplay checkpoint (~2 GiB of VRAM in 0.3 s), the agent's device and file-coverage checks, the DMTCP dump and publishing (13.2 / 27.2 GiB).
    • warmctl up on the same pod: 0.6B 3/3 at 3.1–3.3 s to serving; 8B 3/3 at 4.1–10.9 s (the first read the 27 GiB image cold). Canary matched every time, with the same answers.
    • The snapshot moved to a second pod and another GPU (different gpu_id and render node; same physical host, which RunPod chose): 0.6B 3/3 at 3.1 s, 8B 2/2 at 5.9 s, canary matched. libkfdreplay translated the gpu_id there.
    • Refusal on the pod: a touched libkfdreplay is refused before the restart, with the reason.
    • Found and fixed on the pod, in this PR:
      • PYTHONPATH must keep the ROCm image's amdsmi path;
      • under DMTCP, a process with ROCm initialized cannot fork reliably (a DMTCP fork issue, independent of libkfdreplay). The bake therefore warms the compile caches outside DMTCP first, and the adapter answers platform.architecture() before the GPU starts, so Triton's cache keys match;
      • vLLM 0.29's CUDA wrapper lacks cudaHostRegister, so it is bound from the runtime;
      • the coverage check now accepts image files anywhere (Python lives under /root/.local);
      • the 8B profile's KV cache size.
    • Not covered: another physical host (RunPod placed both pods on one), MI300X, TP>1.

🤖 Generated with Claude Code

kbespalov and others added 17 commits November 15, 2026 02:13
Before another GPU vendor touches shared code, pin what users see today:

- manifest: two published snapshots (DMTCP on H200, beta.17; CRIU with
  cuInterpose on 8xB300, beta.9; GPU UUIDs anonymised, the B300 one with
  40 of its CRIU images) read and write back byte for byte, and writing
  adds no key they lack;
- cli: every command's and alias's usage, flags and defaults;
- oci: a repository holding a snapshot of another manifest schema next to
  an NVIDIA one: Choose skips the foreign entry whatever the tag order
  (and, as a control, picks it under the NVIDIA schema).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- manifest: hardware.vendor, gpu_checkpoint and rocm; a GPU's arch, KFD
  gpu_id and firmware; process.gpu_state, gpu_lib, gpu_owners,
  gpu_max_wptr and mapped (files a restart maps again), all omitempty.
  An AMD manifest carries the schema warmctl.snapshot/v2-rocm, which
  releases before AMD support refuse, so they skip AMD entries of an
  index; Validate ties the schema to the vendor.
- hardware.yaml: MI300X, MI325X, MI350X, MI355X rows (vendor: amd,
  product_name); the NVIDIA rows are unchanged.
- profiles: _defaults-rocm.yaml, laid over the defaults for an AMD host
  (Loader.Vendor): libkfdreplay's environment, ROCm caches under
  /workspace, ipc native, and no --enable-nccl-comm-suspend, which the ROCm
  vLLM (0.29) does not know. qwen3-0.6b and qwen3-8b MI350X profiles.
  profile show/argv/check resolve a profile of AMD rows over that layer.
- Every shipped profile resolves as before (testdata/resolved.sha256,
  NVIDIA rows of the hardware table included).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- host: where NVML cannot be opened, no NVIDIA device exists and /dev/kfd
  lists GPUs this process may read, the GPU session reads the KFD
  topology (name by PCI device ID, VRAM from the memory banks, ISA,
  gpu_id, render node; nodes a container may not read are left out). An
  NVIDIA host, or one with neither vendor, gets NVML's answer as before.
- kfdreplay: the pinned libkfdreplay release (v0.1.0, SHA256SUMS of the
  GitHub release), where the runtime image installs it, and checks of a
  file's size, mtime and digest; scripts/fetch-kfdreplay.sh installs it.
- rocm: the support matrix (gfx950, amdgpu 7.1.3), what an AMD launch
  needs (one GPU, ipc native, the ROCm environment), host compatibility,
  the agent's /proc checks (devices released, libkfdreplay preloaded,
  every mapped file carried by the snapshot), and State, which asks
  every worker to checkpoint or restore its GPU state through
  /collective_rpc.
- accel: the host's vendor and the GPU state an engine moves itself:
  None for NVIDIA, whose state the agent's cuda step moves.
- vllm: the RPCs (warmctl_gpu_checkpoint/restore, and checkpoint_prepare
  and _restore for a vLLM that may lack vLLM's own).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kfdr.py: the preloaded libkfdreplay through ctypes (version, state,
  last_error, max_wptr, checkpoint, restore).
- worker: warmctl_gpu_checkpoint (only from RUNNING, never of a restored
  engine; refusals carry libkfdreplay's reason), warmctl_gpu_restore,
  warmctl_gpu_state, and warmctl_checkpoint_prepare/restore, which run
  vLLM's hooks where they exist. describe reports gfx, HIP, the ROCm
  runtime and libkfdreplay's version on ROCm; on CUDA it is unchanged.
- device: the runtime's own names for the pipelined reload on ROCm
  (hipStreamCreateWithFlags for cudaStreamCreateWithFlags); CUDA keeps its.
The NVIDIA path never calls the new methods.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bake takes the GPU vendor from the host, a restore from the snapshot.

- build on an AMD host: in place under DMTCP (implied in the runtime
  image), the ROCm profile layer, the support matrix and the pinned
  libkfdreplay checked, every worker made to report it; after sleep, the
  workers checkpoint their GPU state before the agent's steps; the
  manifest is v2-rocm with the AMD fields, and no CUDA owner.
- agent: libkfdreplay in the engine's LD_PRELOAD under dmtcp_launch; the
  cuda step checks that no process still holds an AMD device and every
  ROCm process has libkfdreplay; the freeze refuses an engine that maps a
  file the snapshot does not carry, and names it.
- up: the snapshot's vendor must be the host's, checked before anything
  is pulled; an AMD snapshot restores in place with its very libkfdreplay
  (size, mtime, SHA-256) and model files, on the same GPU model, ISA and
  driver, and on another GPU only when the container sees that one; the
  workers restore their GPU state before vLLM's restore hook.
- doctor on an AMD host checks what AMD needs, not Docker or the NVIDIA
  runtime.
Every NVIDIA path is the one it was: the vendor is NVIDIA wherever an
NVIDIA device exists, and AMD code runs only for an AMD vendor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- make amd-e2e-test (tests/integration/amd): a bake and restores in
  unprivileged containers of a stand-in runtime image with the pinned
  DMTCP and libkfdreplay releases, on a KFD topology of MI350X GPUs
  (WARMCTL_TEST_KFD_ROOT) and the stand-in vLLM in an AMD mode: doctor,
  the AMD manifest, a restore on the donor's and on another GPU with the
  same answer, and refusals (another GPU among two, libkfdreplay
  touched, two GPUs per engine). CI runs it, and the ROCm image's native
  stage.
- deploy/rocm/Dockerfile: the ROCm runtime image on rocm/vllm (vLLM 0.29,
  ROCm 10.1), with DMTCP, libkfdreplay and tini.
- docs/amd.md, a README row, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found on an MI350X pod (ROCm 10.1 TheRock, vLLM 0.29):

- The ROCm image finds amdsmi through PYTHONPATH, and vLLM finds the ROCm
  platform through amdsmi; the common defaults' PYTHONPATH (the adapter)
  hid it, and vllm serve failed to infer a device. The ROCm layer keeps
  both.
- A process that has initialized ROCm and forks a compiler under DMTCP
  v5.0.0-warmctl.2 fails about half the time: gcc exits 99 on a DMTCP
  assertion (threadsync.cpp, wrapper execution lock), with or without
  libkfdreplay; without DMTCP it never does. Triton compiles hip_utils and
  its kernel launchers with gcc on a cache miss, and the bake's empty
  /workspace caches miss. An AMD bake now runs the engine once outside
  DMTCP, with the same argv, environment and trees, through the warmup
  grid and the canary, then stops it: the engine under DMTCP finds every
  cache warm and forks nothing.
- hardware.yaml: MI350X's VRAM as the KFD reports it (294896 MiB); the
  sysfs fixture holds the values read on the pod.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found on the MI350X pod. Triton keys its compiled-module cache (hip_utils,
kernel launchers) on platform.architecture(), which forks `file`. Under
DMTCP a process whose ROCm runtime is initialized cannot fork safely (the
fork fails or hangs about half the time, with or without libkfdreplay), so
the key came out different, Triton missed the cache the compile pass had
warmed and forked gcc, which failed too. vLLM imports the worker extension
before the worker initializes the GPU: the adapter asks once there, on ROCm
only, and answers the same from then on. Under DMTCP, hip_utils then loads
from the cache in 0.05 s, 3 of 3 (it hung or failed 3 of 3 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lacks it

Found on the MI350X pod: vLLM 0.29's CudaRTLibrary (the ROCm image's)
wraps neither cudaHostRegister, cudaHostUnregister nor cudaGetLastError,
so the weights export failed. The device binds them from the runtime itself
(hipHostRegister on ROCm) when the wrapper has none; a wrapper that has
them, as NVIDIA's vLLM does, keeps being used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found on the MI350X pod: the ROCm image's Python is under /root/.local
(uv), outside the directories the coverage check took for the image's, and
the freeze refused the engine for mapping its own interpreter. A file the
container started with (older than its PID 1) comes from the image, at any
path; the directory rule stays for files installed since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found on the MI350X pod: the 8B profile's 8192-token context did not fit
the default 1 GiB of KV cache; it gets 8 GiB. A failed bake now keeps the
compile cache pass's engine log with its other logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The H200 DMTCP fixture keeps its structure and every field the golden test
reads, with 3 weight allocations, the 2 parts they use and 2 files of each
other role (7289 lines to 786); the demo profile and snapshot ids are
neutral (golden-dmtcp-tp1). The golden SHA-256 was computed with main's
code and the branch writes the same bytes. Testdata is marked
linguist-generated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n one MI350X

- The ROCm layer no longer names one image's amdsmi path: an AMD bake keeps
  the image's own PYTHONPATH after the adapter's, whatever the image
  (rocm/vllm 0.29's Python 3.14, or a venv with vLLM 0.33+rocm100).
- qwen38-flash-next-mi350x-tp1: Qwen's FP8 release of the 180B-A6B hybrid
  MoE on one MI350X, the PLE table on the GPU, 64 GiB of FP8 KV cache, MTP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…KV in BF16

ROCPROFILER_REGISTER_ENABLED=0: TheRock 10.0 loads rocprofiler-sdk into every
HIP process and its queue interception keeps ROCr's event thread polling in
user space, which libkfdreplay's freeze refuses. AMD_COMGR_CACHE_DIR and
TVM_FFI_CACHE_DIR under /workspace. The model's QSA attention on ROCm takes
BF16 or Octave KV, not FP8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… signal

vLLM 0.33's API server and engine core initialize ROCm when they import
kernels that probe the GPU (aiter, Triton's AMD target, flash-linear-
attention), so their runtime holds the devices a snapshot must release.
warmctl's vLLM general plugin, on only when the engine has
WARMCTL_KFDR_STATUS (AMD bakes), installs SIGRTMIN+6/+7 handlers that call
kfdr_checkpoint(1) / kfdr_restore() in that process and report to a status
file named by its PID. The agent signals the processes that still hold a
device after the workers' checkpoint, and every GPU owner after the DMTCP
restart (workers answer skipped and restore through the engine as before).

Verified on one MI350X with Qwen3.8-Flash-Next FP8 on vLLM 0.33.0+rocm100:
build 184.6 GiB snapshot; up serving in 26-40 s, canary matches, 6 of 7
restores (one queue fast-forward stall, documented).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kbespalov and others added 3 commits November 15, 2026 16:22
… plugin entry point

deploy/images/vllm-rocm-0.33 builds registry.warmctl.io/warmctl/vllm-rocm:
0.33.0-rocm100: Ubuntu 24.04, a Python 3.12 venv with vllm 0.33.0+rocm100,
torch 2.13.0+rocm10.0.0 and torchvision 0.28.0+rocm10.0.0, every wheel pinned
by hash. deploy/rocm/Dockerfile builds warmctl's runtime image on it and now
copies the adapter's dist-info, so vLLM finds warmctl's plugin in the image
as it does where warmctl places the adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.1.1 tracks live GEM handles in a bitmap instead of a 1024-entry table,
which vLLM 0.33's sleep-mode allocator (HIP VMM) outgrows. Checksums are the
release's SHA256SUMS; the ROCm runtime image must be rebuilt to carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… wheel index

- qwen38-27b-mi350x-tp1: Qwen's FP8 release on one MI350X, full 262K
  context, 96 GiB of BF16 KV cache (the model's QSA attention on ROCm takes
  no FP8 KV), MTP. build: 39.7 GiB snapshot in 5.3 min; up: serving in
  13-20 s, GPU restore 1.4 s, weights reloaded in 2 s, canary matches.
- deploy/images/vllm-rocm-0.33 installs from wheels.vllm.ai/rocm/0.33.0/rocm100/:
  the unversioned rocm/ index moved on to vLLM 0.34 and amd-aiter 0.1.28,
  so the hashed lock no longer resolved against it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kbespalov

Copy link
Copy Markdown
Contributor Author

ROCm checkpoint/restore review at d1a3559

The strongest result here is that a warmed vLLM process tree can exit and serve again on an MI350X in an ordinary GPU container. The division of work makes sense. vLLM drains the engine and releases its allocator pools, libkfdreplay reconstructs the remaining GPU objects, and DMTCP carries the host processes. Both backends reuse the weight fingerprints, snapshot distribution and gateway. I would keep that design and address the following correctness issues before merging the preview.

  1. A live event can disappear from the snapshot. In a CPU test of the pinned v0.1.1 recorder and replay routines, with successful KFD calls simulated, 8,191 create/destroy pairs followed by one live event replayed one event. With 8,192 pairs, the same replay returned success and recreated zero. Destroying an event leaves its slot occupied in the journal. Latch a recording error and refuse checkpoint when a record is dropped, or safely reuse slots. Cover queues and buffer objects with the same capacity tests, then update the warmctl pin. Recorder · Replay

  2. The leased GPU and the worker’s GPU can differ. With two visible devices, --gpus 1 selects the lease and manifest entry. The in-place cache pass and engine launch inherit visibility. A CPU test supplied GPU 0’s PCI address in the worker report. Validation succeeded and the manifest named GPU 1. For TP1 preview, requiring exactly one accessible card at bake is sufficient. To support explicit placement, bind both launches and verify the worker’s physical identity before publishing. Launch environment · Worker check · Manifest writer

  3. A container with one usable GPU can be counted as multi-GPU. With two readable KFD nodes and just one render device present, warmctl counted two and refused a different-GPU restore. libkfdreplay counts the render devices present and can remap in exactly this layout. Use the same visibility rule for inventory, placement and restore. Keep this case alongside the fixture where other sysfs nodes return EPERM. Inventory · Restore gate · Library rule

  4. An external mapped file can escape the portability check. A fixture mapped a regular file outside the model and archived trees, with an mtime older than PID 1. Cover returned zero missing files and zero manifest dependencies. After the file was removed, SameFiles still passed. A pre-existing kernel or plugin on a mounted volume has this shape. Check mount provenance and either record the external dependency for receiver preflight or refuse the bake. Coverage · Image-file heuristic

One user-facing fix is independent of replay. warmctl profile show qwen38-27b-mi350x-tp1 resolves to the vLLM 0.29 image, while the profile calls for 0.33. Give the Qwen3.8 profiles the matching image and check the installed runtime before the compile pass. Profile · ROCm defaults

The backend interface currently accepts *vllm.Engine and returns rocm.Result even for NVIDIA. This is a workable seam for these two implementations. If a third backend is added, its checkpoint result should belong to accel, with vendor-specific statistics kept in the implementation. GPUState

NVIDIA compatibility

I compared binaries from 984bc5f and d1a3559. All 102 pre-existing profiles produced byte-identical profile show output and identical exit status. The H200/DMTCP and B300/CRIU manifest goldens and CLI help checks passed. With a valid AMD entry first in a mixed OCI index, the base reader skipped it and chose NVIDIA. The separate ROCm schema earns its keep here. The full Go suite passed uncached on macOS. The Python adapter suite had 40 passes and one Linux-only skip. These checks cover compatibility at the CLI, serialization and selection layers. A hardware restore of an existing CUDA artifact remains the release-level check. Manifest tests · Index tests

What the hardware evidence supports

The previously recorded Qwen3.8-27B FP8 run on one MI350X gave 3/3 matching canaries. The same snapshot reached serving in 12.7, 15.4 and 19.5 s (median 15.4 s). The worker GPU replay took 1.4 s each time. The published smaller-model runs also moved to another physical GPU on the same host. The 180B profile has a documented queue replay stall in one of seven attempts. I would label the supported configuration as a freshly warmed, single-rank MI350X engine on the tested stack. MI355X shares the ISA and still needs a qualification run. TP/RCCL and migration between physical hosts are additional milestones. For the latter, record and compare firmware as well as driver and image. PR hardware results · Library requirements

Upstream CRIU provides a driver-assisted AMD checkpoint path gated by Linux capabilities. Upstream vLLM’s initialized snapshots document a CUDA helper. This PR’s contribution is durable restart of a warmed ROCm inference server under tenant privileges. CRIUgpu’s published AMD measurements used HPC workloads on MI210, so they provide no like-for-like speed ranking here. For a performance claim, compare fresh vLLM with a warm compile cache against restore on the same model, GPU, image and prompts. Record time to first correct response and, at concurrency 1/8/32, output tokens/s and p95 TTFT. Run the fresh engine once with stock settings and once with the replay settings (including HSA_ENABLE_SDMA=0). That separates the cost of those settings from any change after restore. Save the raw results and report failed attempts as well as successful ones. Linux KFD · vLLM initialized snapshots · CRIUgpu §5.5

@kbespalov

Copy link
Copy Markdown
Contributor Author

Checkpoint/restore follow-up

The four review findings are fixed. A physical MI350X run also exposed a fifth issue in the default build → up sequence. Its fix is included in this PR.

Finding Change and regression coverage
A live KFD event could disappear after 8,192 creates libkfdreplay v0.1.2-rc.1 records the first dropped entry and refuses warm and cold checkpoints before device teardown. Tests cover the exact event boundary, buffer objects, queues, mappings and overflow during the copy phase. warmctl pins the release archive and library checksums. Library PR · Release
The lease and worker could name different cards A TP1 bake requires one visible GPU. The worker reports its full physical PCI address through HIP, and a mismatch fails the bake.
Host sysfs could overcount GPUs in a container Inventory intersects KFD topology with the actual render devices. The end-to-end test includes two readable KFD nodes with only one exposed render device.
A mapped file on an external volume could escape preflight The donor checks mount provenance and records the file's path, size and nanosecond mtime. Unit tests cover a read-only bind mount and resolved model symlinks. On the MI350X, changing a mapped library's mtime by 3 s made the receiver reject the snapshot before DMTCP restarted. Coverage tests

MI350X hardware results

Qwen3.8-27B-FP8 TP1, model revision 017b9c7a, ran with vLLM 0.33, torch 2.13.0+rocm10.0.0, amdgpu 7.1.3.31500000 and the published RC. The initial 318.7 s bake produced a 39.65 GiB snapshot including 29.41 GiB of weights. All three ROCm processes released the device. The first up failed because the bake had left a plugin reply in /run/warmctl/kfdr. After clearing that test-owned directory once, three restores opened the gateway in 8.5 / 8.2 / 6.5 s and returned the first correct arithmetic answer in 17.50 / 8.51 / 8.65 s. Weight fingerprints and canaries matched on all three.

aefad18 keeps new plugin replies in the bake's managed workspace and reads the old path for existing snapshots. The fixed binary restored the earlier snapshot, then baked a new one in 288.8 s. The default receiver directory was empty before and after the bake. The immediate up opened the gateway at 9.5 s and returned 51 at 9.71 s, with matching fingerprints and canary. GPU replay took 1.4 s and weight reload took 1.6 s. Donor and receiver used the same physical card. CI now tests this sequence with a late plugin reply. Fix · Final CI

On the restored gateway, vllm bench serve with random 1,024-token prompts and fixed 256-token outputs delivered 80.0 / 349.8 / 723.4 output tokens/s at concurrency 1 / 8 / 32. All 4 / 16 / 64 requests completed. Median TTFT was 178 / 705 / 657 ms. These are short samples. A separate HIP cold cycle on the card restored 35 buffer objects, 72 events and two queues and passed its kernel result check.

A second comparison used the same launch settings, seed and input token IDs, through the direct vLLM endpoint on the same GPU. Two fresh launches used warm compile caches. The first reached direct health in 45.9 s. In two fresh and two restored runs, all three sequential 64-token outputs matched byte for byte. At concurrency 8, the two fresh runs and one restore matched on 16/16 outputs. The other restore differed on 3/16. All four completed all requests. This leaves an open fidelity question under load. A useful next test would fix batch composition and capture the first divergent token and its log probabilities.

Backward compatibility

On an NVIDIA A40, v2.0.0-beta.17 baked Qwen3-0.6B with DMTCP v5.0.0-warmctl.1. Its 7.52 GiB snapshot had 23 files and no hardware.vendor. Receiver db62b22 passed deep verification, restored all three CUDA owners in 0.5 s, reloaded 1.20 GiB in 1.5 s with matching fingerprints, passed the enforced tolerance canary, and served at 5.3 s. A real completion returned HTTP 200. Both sides used the same card, driver 595.112.07 and vLLM 0.32.0. All 102 pre-existing profile outputs and exit codes matched the base commit byte for byte. This hardware test covers NVIDIA DMTCP. Tested receiver

An additional Linux/amd64 test with a pre-RC AMD library accepted the actual v0.1.1 binary at its recorded path, rejected a changed mtime, and rejected a changed byte with the original size and mtime. Keep the original runtime or install that release alongside the new one to restore older AMD snapshots.

@kbespalov

kbespalov commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Release-candidate verification

PR head b230cdc6 pins the published libkfdreplay v0.1.2. All three artifacts match the main-branch rehearsal byte-for-byte, and their GitHub provenance verifies against the release tag and source commit 089b1464. An independent rebuild with the previous version string reproduced the published RC library. Physical MI350X qualification used that RC. Library release workflow

The ordinary AMD end-to-end job fetched the published release and passed on native x86-64. All 12 integration checks passed using the real DMTCP and libkfdreplay libraries, including a same-container bake and restore, equal responses after restoring on two simulated device topologies and five expected refusals. AMD end-to-end · ROCm native package

The complete Linux/amd64 Qwen3.8 image built from the wheel lock. CPU smoke tests covered vLLM 0.33.0+rocm100, PyTorch 2.13.0+rocm10.0.0, the runtime marker and DMTCP with fdkeep and stable libkfdreplay preloaded. Both OCI publication jobs were skipped. The CLI release rehearsal built all four archives and SPDX SBOMs, and tested the Linux packages on native amd64 and arm64. Full ROCm image check · CLI release rehearsal

The previously reported physical MI350X and legacy NVIDIA A40 results remain the hardware evidence. For Qwen3.8-27B FP8, one of two restores differed from fresh starts on three of sixteen prompts at concurrency eight. Exact output reproducibility under batching remains open. Hardware results

@kbespalov
kbespalov merged commit 3255552 into main Nov 17, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant