This commit is contained in:
2026-03-29 05:35:20 +08:00
parent 645358862a
commit abd558839e
3 changed files with 69 additions and 64 deletions
+9 -8
View File
@@ -61,20 +61,21 @@
- `api_key`:接口访问密钥(同时用于 8000 与 8001)
- `tensor_parallel_size`:张量并行数,双卡建议 `2`
- `dtype`:推理精度,默认 `bfloat16`
- `selected_model`:当前生效模型,留空时回退到 `default_model`
- `models.selected`:当前生效模型,留空时回退到 `models.default`
## config.json 说明
`config.json` 采用以下结构:
- 顶层 `default_model`:默认模型名
- 顶层其他键:每个模型的配置档位
- `models.default`:默认模型名
- `models.selected`:当前生效模型名
- `models.profiles`:模型配置集合
- 每个模型至少建议包含:`hf_model_id`、`ctx`、`max_num_seqs`、`max_tokens`、`gpu_util`、`valid_tp`
启动时会按以下优先级选模型:
1. `config.json` 中 `selected_model`
2. `config.json` 中 `default_model`
1. `config.json` 中 `models.selected`
2. `config.json` 中 `models.default`
模型被选中后,会自动覆盖运行参数,包括:
@@ -88,7 +89,7 @@
## 部署步骤
1. 修改 `config.json` 中的 `selected_model` 与服务参数。
1. 修改 `config.json` 中的 `models.selected` 与服务参数。
2. 构建并启动容器:
@@ -129,8 +130,9 @@ curl -X POST "http://localhost:8001/v1/chat/completions" \
- Base URL 使用 `http://<服务器IP>:8001/v1`
- API Key 使用 `config.json` 中 `api_key`
- 模型名使用 `config.json` 中 `served_model_name`
- 模型名使用 `config.json` 中 `models.profiles.<模型名>.served_model_name`
- 若使用工具调用,`config.json` 中应配置 `tool_call_parser` 与 `enable_auto_tool_choice`
- 所有路径按 Ubuntu 规范填写,本地模型建议使用 `/opt/model/<模型目录>`
## 双 AMD R9700 调优建议
@@ -138,4 +140,3 @@ curl -X POST "http://localhost:8001/v1/chat/completions" \
- 首次部署建议设置 `GPU_MEMORY_UTILIZATION=0.90`,稳定后再调高
- 若模型较大且吞吐压力高,可逐步调低 `MAX_MODEL_LEN` 或 `MAX_NUM_SEQS`
- 确保宿主机已正确安装 ROCm 驱动并暴露 `/dev/kfd` 与 `/dev/dri`
+7 -3
View File
@@ -9,12 +9,14 @@
"port": 8001
}
},
"api_key": "",
"api_key": "sk-szcjw",
"tensor_parallel_size": 2,
"dtype": "bfloat16",
"revision": "",
"default_model": "Qwen3.5-35B-A3B-GPTQ-Int4",
"selected_model": "Qwen3.5-35B-A3B-GPTQ-Int4",
"models": {
"default": "Qwen3.5-35B-A3B-GPTQ-Int4",
"selected": "Qwen3.5-35B-A3B-GPTQ-Int4",
"profiles": {
"Qwen3-Next-80B-A3B-Instruct-AWQ-4bit": {
"ctx": "24576",
"trust_remote": true,
@@ -67,4 +69,6 @@
"served_model_name": "Qwen3.5-35B-A3B-GPTQ-Int4",
"hf_model_id": "Qwen/Qwen3.5-35B-A3B-GPTQ-Int4"
}
}
}
}
+2 -2
View File
@@ -10,7 +10,7 @@ services:
- "8000:8000"
volumes:
- /opt/model:/opt/model:ro
- d:/project/rocm_vllm_nightly/rocm_vllm_nightly/config.json:/workspace/config.json:ro
- ./config.json:/workspace/config.json:ro
devices:
- /dev/kfd
- /dev/dri
@@ -35,7 +35,7 @@ services:
- "8001:8001"
volumes:
- /opt/model:/opt/model:ro
- d:/project/rocm_vllm_nightly/rocm_vllm_nightly/config.json:/workspace/config.json:ro
- ./config.json:/workspace/config.json:ro
devices:
- /dev/kfd
- /dev/dri