diff --git a/README.md b/README.md index 45a6593..1a07107 100644 --- a/README.md +++ b/README.md @@ -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` - diff --git a/config.json b/config.json index 2159ac5..5984c67 100644 --- a/config.json +++ b/config.json @@ -9,62 +9,66 @@ "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", - "Qwen3-Next-80B-A3B-Instruct-AWQ-4bit": { - "ctx": "24576", - "trust_remote": true, - "valid_tp": [2], - "max_num_seqs": "32", - "max_tokens": "16384", - "gpu_util": "0.98", - "enforce_eager": false, - "env": { - "VLLM_USE_TRITON_AWQ": "1" - }, - "tool_call_parser": "qwen3_xml", - "enable_auto_tool_choice": true, - "served_model_name": "Qwen3-Next-80B-A3B-Instruct-AWQ-4bit", - "hf_model_id": "cpatonn/Qwen3-Next-80B-A3B-Instruct-AWQ-4bit" - }, - "GLM-4.7-Flash-AWQ": { - "ctx": "32768", - "trust_remote": true, - "valid_tp": [1, 2], - "max_num_seqs": "64", - "max_tokens": "32768", - "gpu_util": "0.98", - "tool_call_parser": "qwen3_xml", - "enable_auto_tool_choice": true, - "served_model_name": "GLM-4.7-Flash-AWQ", - "hf_model_id": "THUDM/GLM-4.7-Flash-AWQ" - }, - "Qwen3.5-27B-FP8": { - "ctx": "32768", - "trust_remote": true, - "valid_tp": [1, 2], - "max_num_seqs": "64", - "max_tokens": "32768", - "gpu_util": "0.98", - "tool_call_parser": "qwen3_xml", - "enable_auto_tool_choice": true, - "served_model_name": "Qwen3.5-27B-FP8", - "hf_model_id": "RedHatAI/Qwen3.5-27B-FP8-dynamic" - }, - "Qwen3.5-35B-A3B-GPTQ-Int4": { - "ctx": "32768", - "trust_remote": true, - "valid_tp": [1, 2], - "max_num_seqs": "64", - "max_tokens": "32768", - "gpu_util": "0.98", - "tool_call_parser": "qwen3_xml", - "enable_auto_tool_choice": true, - "served_model_name": "Qwen3.5-35B-A3B-GPTQ-Int4", - "hf_model_id": "Qwen/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, + "valid_tp": [2], + "max_num_seqs": "32", + "max_tokens": "16384", + "gpu_util": "0.98", + "enforce_eager": false, + "env": { + "VLLM_USE_TRITON_AWQ": "1" + }, + "tool_call_parser": "qwen3_xml", + "enable_auto_tool_choice": true, + "served_model_name": "Qwen3-Next-80B-A3B-Instruct-AWQ-4bit", + "hf_model_id": "cpatonn/Qwen3-Next-80B-A3B-Instruct-AWQ-4bit" + }, + "GLM-4.7-Flash-AWQ": { + "ctx": "32768", + "trust_remote": true, + "valid_tp": [1, 2], + "max_num_seqs": "64", + "max_tokens": "32768", + "gpu_util": "0.98", + "tool_call_parser": "qwen3_xml", + "enable_auto_tool_choice": true, + "served_model_name": "GLM-4.7-Flash-AWQ", + "hf_model_id": "THUDM/GLM-4.7-Flash-AWQ" + }, + "Qwen3.5-27B-FP8": { + "ctx": "32768", + "trust_remote": true, + "valid_tp": [1, 2], + "max_num_seqs": "64", + "max_tokens": "32768", + "gpu_util": "0.98", + "tool_call_parser": "qwen3_xml", + "enable_auto_tool_choice": true, + "served_model_name": "Qwen3.5-27B-FP8", + "hf_model_id": "RedHatAI/Qwen3.5-27B-FP8-dynamic" + }, + "Qwen3.5-35B-A3B-GPTQ-Int4": { + "ctx": "32768", + "trust_remote": true, + "valid_tp": [1, 2], + "max_num_seqs": "64", + "max_tokens": "32768", + "gpu_util": "0.98", + "tool_call_parser": "qwen3_xml", + "enable_auto_tool_choice": true, + "served_model_name": "Qwen3.5-35B-A3B-GPTQ-Int4", + "hf_model_id": "Qwen/Qwen3.5-35B-A3B-GPTQ-Int4" + } + } } } diff --git a/docker-compose.yml b/docker-compose.yml index 1e40c8d..f121078 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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