serving-llms-on-instinct
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseServing LLMs on AMD Instinct
在AMD Instinct上部署LLM
Get a vLLM endpoint running on AMD Instinct GPU hardware.
在AMD Instinct GPU硬件上运行vLLM端点。
Prerequisites
前提条件
- ROCm driver and installed on the GPU host
amd-smi - Docker running and accessible (check with )
docker ps - and
/dev/kfdpresent on the GPU host/dev/dri - HuggingFace token in env var (required for gated models; not required for Qwen3 or Gemma). For gated models (Llama 3.2, Gemma, etc.), the HF token must belong to an account that has accepted the model's license at
HF_TOKEN. A valid token without license acceptance will fail with an opaque "Engine core initialization failed" error.huggingface.co/<model_id> - For remote GPU: SSH key access configured (must work without a password prompt). If only password access is available, set up keys first:
ssh <user>@<host>ssh-copy-id <user>@<host>
- GPU主机上已安装ROCm驱动和
amd-smi - Docker已运行且可访问(通过检查)
docker ps - GPU主机上存在和
/dev/kfd/dev/dri - 环境变量中配置了HuggingFace令牌( gated模型需要;Qwen3或Gemma不需要)。对于 gated模型(如Llama 3.2、Gemma等),HF令牌所属账户必须已在
HF_TOKEN接受模型许可。未接受许可的有效令牌会导致模糊的“Engine core initialization failed”错误。huggingface.co/<model_id> - 对于远程GPU:已配置SSH密钥访问(无需密码提示即可正常工作)。如果仅支持密码访问,请先设置密钥:
ssh <user>@<host>ssh-copy-id <user>@<host>
Data files
数据文件
Read these files directly to get model and GPU configuration:
-
-- model configs synced from vllm-project/recipes. Each entry under
data/recipes_cache.jsoncontains the full recipe withmodels.<HF_ID>.recipe,model.base_args,model.base_env,features.tool_calling.args,features.reasoning.args,hardware_overrides.amd.extra_args. The top-levelhardware_overrides.amd.extra_envfield has the latest resolved vLLM ROCm image.docker_image -
-- GPU-specific configuration. Contains
data/gpu_overrides.json(mandatory for all AMD Instinct),docker_flagskeyed by gfx_version withgpu_configsandenv_defaults, andworkaroundsfor models not yet in vLLM recipes.legacy_models -
-- models in vLLM recipes that cannot be served as LLM endpoints. Includes diffusion/image/audio generation models, embedding models, rerankers, ASR models needing audio pipelines, and models requiring unreleased vLLM nightly builds. Check this before attempting to serve a model. If the user requests a blacklisted model, explain why it won't work and suggest an alternative.
data/blacklist.json
If the user doesn't specify a model, default to Qwen/Qwen3.5-9B: dense
multimodal with MTP, Apache 2.0 license (no HF token needed), fits on a single
GPU, strong reasoning and tool-calling.
直接读取以下文件获取模型和GPU配置:
-
—— 从vllm-project/recipes同步的模型配置。
data/recipes_cache.json下的每个条目包含完整配置,包括models.<HF_ID>.recipe、model.base_args、model.base_env、features.tool_calling.args、features.reasoning.args、hardware_overrides.amd.extra_args。顶层hardware_overrides.amd.extra_env字段包含最新解析的vLLM ROCm镜像。docker_image -
—— GPU专属配置。包含所有AMD Instinct必需的
data/gpu_overrides.json、按gfx版本分类的docker_flags(含gpu_configs和env_defaults),以及尚未纳入vLLM配置的workarounds。legacy_models -
—— vLLM配置中无法作为LLM端点部署的模型。包含扩散/图像/音频生成模型、嵌入模型、重排序模型、需要音频管道的ASR模型,以及需要未发布vLLM nightly版本的模型。部署模型前请先检查此文件。如果用户请求部署黑名单中的模型,请解释原因并建议替代方案。
data/blacklist.json
如果用户未指定模型,默认使用Qwen/Qwen3.5-9B:支持MTP的密集型多模态模型,采用Apache 2.0许可(无需HF令牌),可在单GPU上运行,具备出色的推理和工具调用能力。
Step 1: Detect the GPU
步骤1:检测GPU
bash
python3 scripts/detect.pybash
python3 scripts/detect.pyRemote:
远程部署:
python3 scripts/detect.py --host user@hostname
Returns JSON with `gfx_version`, `vram_gb`, `gpu_count`, `rocm_version`.
| gfx_version | Hardware | VRAM |
|---|---|---|
| gfx950 | MI350X / MI355X | 288 GB HBM3E |
| gfx942 | MI300X (192 GB) / MI325X (256 GB) / MI300A (128 GB) | varies |
If `gfx_version` is `unknown`: `amd-smi` ran but found no GPU. Check
`lsmod | grep amdgpu`.python3 scripts/detect.py --host user@hostname
返回包含`gfx_version`、`vram_gb`、`gpu_count`、`rocm_version`的JSON数据。
| gfx_version | 硬件 | 显存 |
|---|---|---|
| gfx950 | MI350X / MI355X | 288 GB HBM3E |
| gfx942 | MI300X (192 GB) / MI325X (256 GB) / MI300A (128 GB) | 按需分配 |
如果`gfx_version`为`unknown`:`amd-smi`已运行但未检测到GPU。请检查`lsmod | grep amdgpu`。Step 2: Validate the environment
步骤2:验证环境
bash
python3 scripts/validate.py --auto-fixbash
python3 scripts/validate.py --auto-fixRemote:
远程部署:
python3 scripts/validate.py --auto-fix --host user@hostname
Returns JSON with `ready` (bool), `errors`, `warnings`, `fixes_applied`.
Do not proceed if `ready` is `false`.python3 scripts/validate.py --auto-fix --host user@hostname
返回包含`ready`(布尔值)、`errors`、`warnings`、`fixes_applied`的JSON数据。如果`ready`为`false`,请勿继续操作。Step 3: Refresh recipes (if stale)
步骤3:刷新配置(若已过期)
Check in . If older than 24 hours or
the file is missing, refresh:
fetched_atdata/recipes_cache.jsonbash
python3 scripts/sync_recipes.pyThis shallow-clones vllm-project/recipes from GitHub and fetches the latest
Docker tag from Docker Hub. Takes ~10 seconds. If it fails, the existing
cache still works.
查看中的字段。如果超过24小时或文件缺失,请刷新:
data/recipes_cache.jsonfetched_atbash
python3 scripts/sync_recipes.py此命令会浅克隆GitHub上的vllm-project/recipes,并从Docker Hub获取最新的Docker标签。耗时约10秒。如果刷新失败,现有缓存仍可正常使用。
Step 4: Construct the Docker command
步骤4:构建Docker命令
Read and directly.
Build the Docker command by combining:
data/recipes_cache.jsondata/gpu_overrides.json- Docker flags from (mandatory for all AMD GPUs)
gpu_overrides.json > docker_flags - HF cache mount: (if a shared model cache directory exists on the host, check whether
-v ~/.cache/huggingface:/root/.cache/huggingfacedirectories are at the cache root or inside amodels--*subdirectory -- mount accordingly tohub/or/root/.cache/huggingface)/root/.cache/huggingface/hub - Port: (default 8000)
-p <port>:<port> - Environment variables: merge with the recipe's
gpu_configs.<gfx_version>.env_defaultsandmodel.base_env. Always addhardware_overrides.amd.extra_env.--env HF_TOKEN=${HF_TOKEN} - Docker image: use from
docker_imagetop level (unless the model needs a pinned image, e.g. GLM-4.5 needsrecipes_cache.json). If the user specifies a Docker image version, check it against the recipe'sv0.15.1. Warn if the image is older -- the model may crash on startup with an opaque "Engine core initialization failed" error.model.min_vllm_version - Model ID:
--model <HF_ID> - vLLM args: combine the recipe's +
model.base_args+hardware_overrides.amd.extra_args+features.tool_calling.args. Addfeatures.reasoning.argsif not present. For multi-GPU, add--enable-auto-tool-choice(see VRAM estimation below). For MoE models on multi-GPU, also add--tensor-parallel-size N.--distributed-executor-backend mp - Port arg:
--port <port>
If the exact model ID is not in , check for a base model
match by stripping date/version suffixes (e.g., matches
). Use the base model's recipe if found.
recipes_cache.jsonKimi-K2-InstructKimi-K2-Instruct-0905If no recipe match, check in . If not
there either, use a generic config with
.
legacy_modelsgpu_overrides.json--enable-auto-tool-choice --trust-remote-code --tool-call-parser hermesPrecision variant selection: Recipes may offer variants (default, fp8,
nvfp4). Check in
before selecting a variant. On gfx942 (MI300X), only
, , , and are hardware-native. MXFP4 and NVFP4
compute is emulated (dequant to BF16 during matmul), but weights stay
compressed in VRAM so quantized models still fit in less memory.
On gfx950 (MI350X), MXFP4 is hardware-native.
gpu_configs.<gfx_version>.precision.nativegpu_overrides.jsonbf16fp16fp8_fnuzint8VRAM estimation and fit check: Before constructing the Docker command,
estimate whether the model fits the available hardware:
bash
python3 scripts/estimate_vram.py --model-id <HF_ID> --vram-gb <per_gpu_vram> --tp <N>This queries the HuggingFace Hub API (no model download) and returns JSON with:
- -- total weight size
weight_memory_gb - -- KV cache cost per token at BF16
kv_cache_bytes_per_token - -- whether weights fit at the given TP
fit.weights_fit - -- max context the GPU can serve
fit.recommended_max_model_len - -- true if KV cache limits context below the model's native max
fit.context_limited - -- minimum TP needed (only if weights don't fit)
fit.min_tp_required
Understanding the overhead: The script reserves ~4 GB for vLLM's runtime
overhead (activation profiling, HIP graph capture, internal buffers). During
startup, vLLM runs a profiling forward pass to measure peak activations, then
captures HIP graphs for optimized decode. This startup peak is higher than
steady-state. The field reflects what's left after
weights and this overhead.
remaining_for_kv_gbUse to decide:
remaining_for_kv_gb- : safe to run. If
remaining_for_kv_gb >= 6, addcontext_limited: trueto the vLLM args. Mention the FP8 KV cache option (--max-model-len <recommended_max_model_len>) if the user needs longer context (--kv-cache-dtype fp8shows the gain).fit.max_seq_len_fp8_kv - between 2 and 6: tight but worth trying. Launch normally. If vLLM OOMs during HIP graph capture (check container logs for "out of memory" after "capturing CUDA/HIP graphs"), retry with
remaining_for_kv_gbadded to the vLLM args. This skips graph capture and frees 1-2 GB. The only cost is slightly higher decode latency.--enforce-eager - : too tight. Will likely OOM during the activation profiling step. Do not attempt.
remaining_for_kv_gb < 2 - with multiple GPUs: re-run with
weights_fit: falseand check again.--tp <min_tp_required> - , not enough GPUs: look for quantized alternatives in this order: a. Recipe variants: the recipe may have
weights_fit: falseorfp8variants with a differentmxfp4that points to a quantized checkpoint. b. Same provider: many providers release quantized versions alongside the base model (e.g.model_idfrom Qwen). Search HuggingFace forQwen/Qwen3.5-122B-FP8with FP8/GPTQ/AWQ suffixes. c. AMD quantized: AMD's Quark team publishes quantized models under the<provider>/<model-name>org on HuggingFace (e.g.amd/). Search foramd/Kimi-K2-Instruct-w-mxfp4-a-fp8variants. Runamd/<model-name>on the quantized model ID to verify it fits, then use that model ID instead.estimate_vram.py - Still doesn't fit: tell the user the model requires more VRAM than available and suggest either a smaller model or multi-GPU hardware. Do not attempt to launch.
Docker command template:
docker run -d --name vllm-<model-slug> \
<docker_flags> \
-v <hf_cache_mount> \
-p <port>:<port> \
--env <key>=<value> (for each env var) \
--env HF_TOKEN=${HF_TOKEN} \
<docker_image> \
--model <model_id> \
<vllm_args> \
--port <port>直接读取和,通过以下步骤构建Docker命令:
data/recipes_cache.jsondata/gpu_overrides.json- Docker标志:来自(所有AMD GPU必需)
gpu_overrides.json > docker_flags - HF缓存挂载:(如果主机上存在共享模型缓存目录,请检查
-v ~/.cache/huggingface:/root/.cache/huggingface目录是否位于缓存根目录或models--*子目录下,据此挂载到hub/或/root/.cache/huggingface)/root/.cache/huggingface/hub - 端口:(默认8000)
-p <port>:<port> - 环境变量:合并、配置中的
gpu_configs.<gfx_version>.env_defaults和model.base_env。务必添加hardware_overrides.amd.extra_env。--env HF_TOKEN=${HF_TOKEN} - Docker镜像:使用顶层的
recipes_cache.json(除非模型需要固定版本镜像,例如GLM-4.5需要docker_image)。如果用户指定了Docker镜像版本,请与配置中的v0.15.1进行核对。如果镜像版本过旧,请发出警告——模型启动时可能会出现模糊的“Engine core initialization failed”错误。model.min_vllm_version - 模型ID:
--model <HF_ID> - vLLM参数:合并配置中的+
model.base_args+hardware_overrides.amd.extra_args+features.tool_calling.args。如果未包含features.reasoning.args,请添加该参数。对于多GPU部署,添加--enable-auto-tool-choice(请参考下方显存估算)。对于多GPU上的MoE模型,还需添加--tensor-parallel-size N。--distributed-executor-backend mp - 端口参数:
--port <port>
如果精确的模型ID不在中,请通过去除日期/版本后缀(例如匹配)查找基础模型匹配项。如果找到,使用基础模型的配置。
recipes_cache.jsonKimi-K2-InstructKimi-K2-Instruct-0905如果未找到匹配的配置,请检查中的。如果仍未找到,使用通用配置:。
gpu_overrides.jsonlegacy_models--enable-auto-tool-choice --trust-remote-code --tool-call-parser hermes精度变体选择:配置可能提供多种变体(默认、fp8、nvfp4)。选择变体前,请查看中的。在gfx942(MI300X)上,仅、、和是硬件原生支持的。MXFP4和NVFP4计算为模拟实现(矩阵乘法期间反量化为BF16),但权重仍以压缩形式存储在显存中,因此量化模型仍可节省内存。在gfx950(MI350X)上,MXFP4是硬件原生支持的。
gpu_overrides.jsongpu_configs.<gfx_version>.precision.nativebf16fp16fp8_fnuzint8显存估算与适配检查:构建Docker命令前,请估算模型是否适配可用硬件:
bash
python3 scripts/estimate_vram.py --model-id <HF_ID> --vram-gb <per_gpu_vram> --tp <N>此命令查询HuggingFace Hub API(无需下载模型),返回包含以下内容的JSON数据:
- —— 总权重大小
weight_memory_gb - —— BF16精度下每个令牌的KV缓存开销
kv_cache_bytes_per_token - —— 给定TP配置下权重是否适配
fit.weights_fit - —— GPU可支持的最大上下文长度
fit.recommended_max_model_len - —— 如果KV缓存限制上下文长度低于模型原生最大值,则为true
fit.context_limited - —— 所需的最小TP值(仅当权重无法适配时返回)
fit.min_tp_required
理解开销:该脚本为vLLM运行时开销(激活分析、HIP图捕获、内部缓冲区)预留约4GB显存。启动期间,vLLM会运行一次分析前向传递以测量峰值激活,然后捕获HIP图以优化解码。此启动峰值高于稳态。字段反映权重和此开销后的剩余显存。
remaining_for_kv_gb使用进行决策:
remaining_for_kv_gb- :可安全运行。如果
remaining_for_kv_gb >= 6,请在vLLM参数中添加context_limited: true。如果用户需要更长上下文(--max-model-len <recommended_max_model_len>显示增益),可提及FP8 KV缓存选项(fit.max_seq_len_fp8_kv)。--kv-cache-dtype fp8 - 介于2和6之间:显存紧张但值得尝试。正常启动。如果vLLM在HIP图捕获期间出现OOM(检查容器日志中“capturing CUDA/HIP graphs”后的“out of memory”),请重试并在vLLM参数中添加
remaining_for_kv_gb。这会跳过图捕获并释放1-2GB显存,代价是解码 latency略有增加。--enforce-eager - :显存过于紧张。激活分析步骤可能会出现OOM。请勿尝试部署。
remaining_for_kv_gb < 2 - 且有多个GPU:使用
weights_fit: false重新运行并再次检查。--tp <min_tp_required> - 且GPU数量不足:按以下顺序查找量化替代方案: a. 配置变体:配置可能包含
weights_fit: false或fp8变体,其mxfp4指向量化检查点。 b. 同一提供商:许多提供商在发布基础模型的同时也会发布量化版本(例如Qwen的model_id)。在HuggingFace上搜索Qwen/Qwen3.5-122B-FP8并带有FP8/GPTQ/AWQ后缀。 c. AMD量化模型:AMD的Quark团队在HuggingFace的<provider>/<model-name>组织下发布量化模型(例如amd/)。搜索amd/Kimi-K2-Instruct-w-mxfp4-a-fp8变体。 对量化模型ID运行amd/<model-name>以验证是否适配,然后使用该模型ID进行部署。estimate_vram.py - 仍无法适配:告知用户模型所需显存超过可用显存,并建议使用更小的模型或多GPU硬件。请勿尝试部署。
Docker命令模板:
docker run -d --name vllm-<model-slug> \
<docker_flags> \
-v <hf_cache_mount> \
-p <port>:<port> \
--env <key>=<value> (每个环境变量对应一行) \
--env HF_TOKEN=${HF_TOKEN} \
<docker_image> \
--model <model_id> \
<vllm_args> \
--port <port>Step 5: Confirm with the user
步骤5:与用户确认
Before launching, present a summary and ask the user to confirm:
- Model: full HuggingFace ID (e.g. )
Qwen/Qwen3.5-122B-Instruct - Precision: variant being used (e.g. BF16, FP8) and why
- Weight memory: from estimate_vram.py
- GPU: detected hardware and VRAM
- TP: tensor parallelism degree (1, 2, 4, 8)
- Context: max achievable context length (and whether it's limited)
- Port: which port the endpoint will be on
If a quantized alternative was selected (Step 4 fit check), explain that
the original model doesn't fit and which alternative is being used.
Wait for the user's confirmation before proceeding.
启动前,请向用户展示摘要并请求确认:
- 模型:完整的HuggingFace ID(例如)
Qwen/Qwen3.5-122B-Instruct - 精度:使用的变体(例如BF16、FP8)及原因
- 权重内存:来自estimate_vram.py的结果
- GPU:检测到的硬件和显存
- TP:张量并行度(1、2、4、8)
- 上下文:可实现的最大上下文长度(以及是否受限)
- 端口:端点将使用的端口
如果在步骤4的适配检查中选择了量化替代方案,请解释原模型无法适配,并说明使用的替代模型。
等待用户确认后再继续操作。
Step 6: Launch and verify
步骤6:启动与验证
Before launching, check for port conflicts:
bash
ss -tlnp 2>/dev/null | grep ':<port> 'If a Docker container is on that port, stop it with .
docker rm -f <name>Run the Docker command. Then poll health using this loop:
bash
while docker inspect --format='{{.State.Running}}' <container_name> 2>/dev/null | grep -q true; do
curl -sf http://localhost:<port>/health && echo "READY" && exit 0
sleep 60
done
echo "FAILED -- container exited"A 503 during loading is normal. Choose the polling strategy based on
model size (weight memory from hf-mem):
- Small models (< 100 GB weights): run the poll as a blocking command
with the Bash tool's set to 600000 (10 minutes). Most cached models are ready within 2-5 minutes.
timeout - Large models (>= 100 GB weights): run the poll with the Bash tool's
set to
run_in_background. Then usetruewithTaskOutputandblock: trueto wait up to 10 minutes per check. If the task is still running after that, calltimeout: 600000again with the same parameters. This uses only 1 turn per 10-minute wait instead of burning a turn every check. The background loop runs until the container is healthy or dies.TaskOutput
After health returns 200, send a warmup request (triggers HIP kernel compilation,
~40-45 seconds on gfx942):
bash
curl -s http://localhost:<port>/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"<model_id>","messages":[{"role":"user","content":"say hi"}],"max_tokens":5}'After the warmup succeeds, present a connection table so the user can call
the endpoint immediately:
| Field | Value |
|---|---|
| Model | |
| Served model name | |
| Base URL | |
| API key | none (local) |
| Port | |
| Tensor parallel | |
| Max context | |
| GPU | |
Then give a ready-to-run example using those exact values:
bash
curl -s http://<host>:<port>/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"<model_id>","messages":[{"role":"user","content":"Hello"}]}'启动前,请检查端口冲突:
bash
ss -tlnp 2>/dev/null | grep ':<port> '如果该端口已被Docker容器占用,请使用停止容器。
docker rm -f <name>运行Docker命令。然后使用以下循环轮询健康状态:
bash
while docker inspect --format='{{.State.Running}}' <container_name> 2>/dev/null | grep -q true; do
curl -sf http://localhost:<port>/health && echo "READY" && exit 0
sleep 60
done
echo "FAILED -- container exited"加载期间出现503错误是正常现象。根据模型大小(来自hf-mem的权重内存)选择轮询策略:
- 小型模型(权重<100GB):将轮询作为阻塞命令运行,Bash工具的设置为600000(10分钟)。大多数缓存模型会在2-5分钟内就绪。
timeout - 大型模型(权重>=100GB):将轮询设置为后台运行(Bash工具的设为
run_in_background)。然后使用true,设置TaskOutput和block: true,每次检查最多等待10分钟。如果任务在该时间后仍在运行,请再次调用timeout: 600000并使用相同参数。这样每10分钟仅占用一次交互轮次,而非每次检查都消耗轮次。后台循环会持续运行,直到容器健康或停止。TaskOutput
健康检查返回200后,发送预热请求(触发HIP内核编译,在gfx942上约需40-45秒):
bash
curl -s http://localhost:<port>/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"<model_id>","messages":[{"role":"user","content":"say hi"}],"max_tokens":5}'预热成功后,向用户展示连接表,以便立即调用端点:
| 字段 | 值 |
|---|---|
| 模型 | |
| 部署模型名称 | |
| 基础URL | |
| API密钥 | 无(本地部署) |
| 端口 | |
| 张量并行 | |
| 最大上下文 | |
| GPU | |
然后提供使用上述值的可直接运行示例:
bash
curl -s http://<host>:<port>/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"<model_id>","messages":[{"role":"user","content":"Hello"}]}'Remote vs. local
远程部署 vs 本地部署
All scripts accept . When given, they SSH to the target.
Set and env vars to avoid passing
every time.
--host user@hostnameROCM_SSH_HOSTROCM_SSH_USER--hostFor remote Docker commands, run them over SSH:
bash
ssh user@host 'docker run -d ...'Use for health/warmup curl URLs (curl runs on the remote host).
localhost所有脚本均支持参数。指定该参数后,脚本会通过SSH连接到目标主机。可设置环境变量和,避免每次都传递参数。
--host user@hostnameROCM_SSH_HOSTROCM_SSH_USER--host对于远程Docker命令,通过SSH运行:
bash
ssh user@host 'docker run -d ...'健康检查/预热的curl URL使用(curl在远程主机上运行)。
localhostGotchas
常见问题
CUDA_VISIBLE_DEVICESHIP_VISIBLE_DEVICESCUDA_VISIBLE_DEVICES=0,1HIP_VISIBLE_DEVICES=0,1unset CUDA_VISIBLE_DEVICES--env CUDA_VISIBLE_DEVICES=FP4BMM crash on gfx942 (MI300X) -- If the container exits immediately
with a segfault or illegal instruction: must be
on gfx942. This is set correctly in for gfx942.
See vLLM issue #34641.
VLLM_ROCM_USE_AITER_FP4BMM0gpu_overrides.jsonHIP error: no kernel imagevllm/vllm-openai-rocm:latestMLA models need -- DeepSeek-R1/V3, Kimi-K2.5.
Without it the MLA attention backend silently falls back to a slower path.
This is in the recipe args for these models.
--block-size 1MoE models on multi-GPU need --
Qwen3-235B, GLM-4.5, MiniMax-M2. The default distributed executor does not
work reliably with MoE on ROCm.
--distributed-executor-backend mpOOM during HIP graph capture -- If the container logs show "out of memory"
after "capturing CUDA graphs" or "capturing HIP graphs", the model fits in
VRAM but there isn't enough headroom for graph capture. Retry with
added to the vLLM args. This disables graph capture and
frees 1-2 GB. Trade-off: slightly higher decode latency, but the model runs.
--enforce-eager"Engine core initialization failed" -- This opaque error means the engine
core subprocess died. Check early container logs: . Common causes: gated model access denied (license not accepted on
HF), unsupported architecture on this vLLM version, OOM during weight loading,
missing for custom architectures, or vLLM version too old
for the model (check in the recipe).
docker logs <name> 2>&1 | head -50--trust-remote-codemin_vllm_version/dev/kfdvideorendersudo usermod -aG video,render $USERSSH key not configured -- The scripts use SSH. If SSH
fails with , configure key-based access first.
BatchMode=yesPermission denied (publickey)Restricting GPUs on shared hosts -- Use
or to target specific GPUs by index.
is the canonical AMD variable;
also works (ROCm maps it). Never set either to an empty string.
--env HIP_VISIBLE_DEVICES=0,1--env CUDA_VISIBLE_DEVICES=0,1HIP_VISIBLE_DEVICESCUDA_VISIBLE_DEVICESCUDA_VISIBLE_DEVICESHIP_VISIBLE_DEVICESCUDA_VISIBLE_DEVICES=0,1HIP_VISIBLE_DEVICES=0,1unset CUDA_VISIBLE_DEVICES--env CUDA_VISIBLE_DEVICES=gfx942(MI300X)上的FP4BMM崩溃 —— 如果容器立即退出并出现段错误或非法指令:gfx942上必须将设置为。中已为gfx942正确配置此参数。请参考vLLM问题#34641。
VLLM_ROCM_USE_AITER_FP4BMM0gpu_overrides.jsonHIP error: no kernel imagevllm/vllm-openai-rocm:latestMLA模型需要 —— DeepSeek-R1/V3、Kimi-K2.5。如果不设置该参数,MLA注意力后端会静默回退到较慢路径。这些模型的配置参数中已包含该设置。
--block-size 1多GPU上的MoE模型需要 —— Qwen3-235B、GLM-4.5、MiniMax-M2。默认分布式执行器在ROCm上无法可靠运行MoE模型。
--distributed-executor-backend mpHIP图捕获期间出现OOM —— 如果容器日志中“capturing CUDA graphs”或“capturing HIP graphs”后显示“out of memory”,说明模型可适配显存,但图捕获的显存余量不足。请重试并在vLLM参数中添加。这会禁用图捕获并释放1-2GB显存,代价是解码 latency略有增加,但模型可正常运行。
--enforce-eager"Engine core initialization failed" —— 此模糊错误表示引擎核心子进程已终止。请查看容器早期日志:。常见原因:gated模型访问被拒绝(未在HF上接受许可)、此vLLM版本不支持该架构、权重加载期间出现OOM、自定义架构缺少参数,或vLLM版本过旧无法支持该模型(请检查配置中的)。
docker logs <name> 2>&1 | head -50--trust-remote-codemin_vllm_version/dev/kfdvideorendersudo usermod -aG video,render $USERSSH密钥未配置 —— 脚本使用模式的SSH。如果SSH出现错误,请先配置基于密钥的访问。
BatchMode=yesPermission denied (publickey)共享主机上限制GPU —— 使用或按索引指定目标GPU。是AMD的标准变量;也可使用(ROCm会映射该变量)。请勿将任一变量设置为空字符串。
--env HIP_VISIBLE_DEVICES=0,1--env CUDA_VISIBLE_DEVICES=0,1HIP_VISIBLE_DEVICESCUDA_VISIBLE_DEVICESReference
参考资料
Precision compatibility, VRAM estimation, Docker flags, and known quirks:
reference.md
精度兼容性、显存估算、Docker标志及已知问题:
reference.md