Repository navigation
AMD Instinct support (preview): libkfdreplay + DMTCP, vendor chosen automatically - #78
Conversation
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>
… 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>
ROCm checkpoint/restore review at
|
Checkpoint/restore follow-upThe four review findings are fixed. A physical MI350X run also exposed a fifth issue in the default
MI350X hardware resultsQwen3.8-27B-FP8 TP1, model revision
On the restored gateway, 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 compatibilityOn an NVIDIA A40, An additional Linux/amd64 test with a pre-RC AMD library accepted the actual |
Release-candidate verificationPR head 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 |
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-checkpointfor AMD, and CRIU'samdgpuplugin 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
buildtakes the vendor from the host. AMD only where no NVIDIA device exists and/dev/kfdlists GPUs this process can read; NVIDIA everywhere else, as before.profiles/_defaults-rocm.yamlover the defaults.uptakes the vendor from the snapshot. An AMD snapshot is refused on an NVIDIA host, and vice versa, before anything is pulled.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 plainv2schema would cause.Where it plugs in
host.Session: a KFD-sysfs implementation, picked inopenSessiononly where NVML cannot be opened and the host is AMD.catalog,pull,mirror,doctor,hardwareand restore's host checks work unchanged.internal/rocm: support matrix (gfx950, amdgpu 7.1.3), launch checks, host compatibility, the agent's/procchecks, andState, which drives the workers' RPCs.internal/accel: the host's vendor, plus aGPUStatehook at checkpoint and wake. For NVIDIA it isNone, a no-op.LD_PRELOAD;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 onrocm/vllm(vLLM 0.29, ROCm 10.1).NVIDIA stays byte for byte
The first commit pins today's behaviour before anything else changes:
--helpis 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 markedlinguist-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 withmain's code.Test plan
go vet,go test -race ./...on Linux and macOS; golangci-lint v2.14.0 (./...andtests/...with criu,e2e tags); ruff; pytest on Python 3.9 and 3.12.go test ./...on its own (the first six; later commits are fixes found on the GPU).make criu-testandmake e2e-teston this branch (NVIDIA path with fake NVML: CRIU, Docker receiver, pod image, push/pull): pass.make amd-e2e-test(also in CI), 9/9 pass. It runs unprivileged containers with the real warmctl, DMTCPv5.0.0-warmctl.2and 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;gpu_idand render node), with the same answer on both;rocm/vllm0.29 base. Inside it:--enable-nccl-comm-suspend, absent from vLLM 0.29, must be dropped on AMD.kfdr_restore.4fc8309:warmctl doctoron 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 buildQwen3-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 upon 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.gpu_idand 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 thegpu_idthere.PYTHONPATHmust keep the ROCm image's amdsmi path;platform.architecture()before the GPU starts, so Triton's cache keys match;cudaHostRegister, so it is bound from the runtime;/root/.local);🤖 Generated with Claude Code