跳转至

MiniMax-M2

1 简介

MiniMax-M2 是 MiniMax 的旗舰大语言模型系列,包括 MiniMax-M2.5 和 MiniMax-M2.7。它针对代码生成、智能体工具调用/搜索以及复杂办公工作流等高价值场景进行了强化,并注重在困难任务上的推理效率和端到端速度。

本文档将展示 MiniMax-M2.5 和 MiniMax-M2.7 的主要验证步骤,包括支持的功能、功能配置、环境准备、单节点和多节点部署、精度与性能评估。

本文档基于最新版本的 vLLM-Ascend 编写。MiniMax-M2.5 和 MiniMax-M2.7 均获得完整支持。若要使用最新功能(例如 PD 分离、EAGLE3 投机解码),建议使用最新版本。

2 支持的功能

请参阅支持的功能列表以获取模型支持的功能矩阵。

请参阅功能指南以获取功能配置。

3 前提条件

3.1 模型权重

以下模型权重和 EAGLE3 权重可在 ModelScope 上获取。请在ModelScope上搜索对应的模型名称,以获取最新的权重文件。

模型 描述 推荐硬件 来源
MiniMax-M2.7-w8a8-QuaRot M2.7 W8A8 量化版本 1× Atlas 800 A3(64GB × 16)或 1× Atlas 800I A2(64GB × 8) MiniMax-M2.7-w8a8-QuaRot
MiniMax-M2.5-w8a8-QuaRot M2.5 W8A8 量化版本 1× Atlas 800 A3(64GB × 16)或 1× Atlas 800I A2(64GB × 8) MiniMax-M2.5-w8a8-QuaRot
MiniMax-M2.7-w8a8c8-QuaRot M2.7 W8A8C8 量化版本 1× Atlas 800 A3(64GB × 16)或 1× Atlas 800I A2(64GB × 8) MiniMax-M2.7-w8a8c8-QuaRot
EAGLE3 (M2.7) M2.7 投机解码头模型 与基础模型节点数一致 MiniMax-M2.7-eagle-model
EAGLE3 (M2.5) M2.5 投机解码头模型 与基础模型节点数一致 MiniMax-M2.5-eagle-model

建议将模型权重下载到共享目录,例如 /root/.cache/。

路径说明:将模型权重下载到任意目录并记录该路径。确保后续部署命令中的模型路径与该目录一致。

3.2 验证多节点通信(可选)

如果需要部署多节点环境,请按照验证多节点通信环境验证多节点通信。

4 安装

4.1 Docker 镜像安装

您可以使用官方一体化 Docker 镜像。有关可用的镜像标签和已发布版本,请参阅使用 Docker。

Docker 运行:

export IMAGE=quay.io/ascend/vllm-ascend:v0.23.0-a3

docker run \
    --name vllm-ascend-env \
    --ipc host \
    --net host \
    --device /dev/davinci0 \
    --device /dev/davinci1 \
    --device /dev/davinci2 \
    --device /dev/davinci3 \
    --device /dev/davinci4 \
    --device /dev/davinci5 \
    --device /dev/davinci6 \
    --device /dev/davinci7 \
    --device /dev/davinci8 \
    --device /dev/davinci9 \
    --device /dev/davinci10 \
    --device /dev/davinci11 \
    --device /dev/davinci12 \
    --device /dev/davinci13 \
    --device /dev/davinci14 \
    --device /dev/davinci15 \
    --device /dev/davinci_manager \
    --device /dev/devmm_svm \
    --device /dev/hisi_hdc \
    -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
    -v /usr/local/dcmi:/usr/local/dcmi \
    -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
    -v /etc/ascend_install.info:/etc/ascend_install.info \
    -v /usr/local/sbin:/usr/local/sbin \
    -it -d $IMAGE bash

Note

A3 采用双 die 设计,共有 8 个 NPU(总计 16 个芯片:/dev/davinci[0-15])。 如果使用的是共享机器,请仅映射所需的芯片(例如,NPU 0-3 对应 /dev/davinci[0-7])。

Docker 运行:

export IMAGE=quay.io/ascend/vllm-ascend:v0.23.0

docker run \
    --name vllm-ascend-env \
    --ipc host \
    --net host \
    --device /dev/davinci0 \
    --device /dev/davinci1 \
    --device /dev/davinci2 \
    --device /dev/davinci3 \
    --device /dev/davinci4 \
    --device /dev/davinci5 \
    --device /dev/davinci6 \
    --device /dev/davinci7 \
    --device /dev/davinci_manager \
    --device /dev/devmm_svm \
    --device /dev/hisi_hdc \
    -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
    -v /usr/local/dcmi:/usr/local/dcmi \
    -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
    -v /etc/ascend_install.info:/etc/ascend_install.info \
    -v /usr/local/sbin:/usr/local/sbin \
    -it -d $IMAGE bash

Tip

上述挂载是访问 NPU 驱动所需的最小配置。请根据环境需要添加额外的 -v 挂载(例如模型权重路径、数据集)。

默认工作目录为 /workspace。vLLM 和 vLLM-Ascend 作为 Python 包安装在 site-packages 中。

安装验证:

启动容器后,运行以下命令以验证安装:

docker ps | grep vllm-ascend-env

预期结果:容器以 Up 状态列出。你也可以在容器内验证 vllm-ascend 版本:

pip show vllm-ascend

预期结果:显示版本信息,且与拉取的镜像版本一致。

4.2 源代码安装

如果你更倾向于从源代码构建,而不是使用 Docker 镜像,请按照安装指南安装 vLLM-Ascend。

要验证源代码安装:

python -c "import vllm_ascend; print(vllm_ascend.__version__)"

5 在线服务部署

Note

在本教程中,我们假设你已经下载了模型权重。请将 /path/to/weight/ 替换为你的实际模型权重路径。

5.1 单节点在线部署

单节点部署在同一节点内同时完成 Prefill 和 Decode,适用于开发、测试以及低至中等吞吐量的生产场景。

常见问题提示: 如果遇到 OOM、HCCL 端口冲突或其他启动问题,请参阅公共常见问题进行排查。对于 MiniMax 特有问题,请参阅第 10 章常见问题。

A3(单节点)

以下是在短上下文条件(例如 3.5k 输入 / 1.5k 输出)下实现良好性能的推荐启动配置。

说明:

  • 如果你只关注短上下文低延迟,可以设置 --max-model-len 32768、--tensor-parallel-size 4 和 --data-parallel-size 4。
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
sysctl -w vm.swappiness=0
sysctl -w kernel.numa_balancing=0
sysctl kernel.sched_migration_cost_ns=50000

export HCCL_BUFFSIZE=1024
export HCCL_OP_EXPANSION_MODE="AIV"
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True

# Ensure the model path matches the directory recorded during download
vllm serve /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
    --served-model-name "MiniMax-M2.7" \
    --host 0.0.0.0 \
    --port 8000 \
    --trust-remote-code \
    --quantization ascend \
    --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY"}' \
    --additional-config '{"scheduler_config":{"enable_balance_scheduling":false},
                          "enable_cpu_binding":true,
                          "enable_fused_mc2":1,
                          "weight_nz_mode":1}' \
    --enable-expert-parallel \
    --tensor-parallel-size 4 \
    --data-parallel-size 4 \
    --max-num-seqs 48 \
    --max-model-len 40690 \
    --max-num-batched-tokens 16384 \
    --gpu-memory-utilization 0.85 \
    --speculative_config '{"enforce_eager": true, "method": "eagle3", "model": "/path/to/weight/Eagle3/", "num_speculative_tokens": 3}'

注意:以上参数仅在特定测试环境中经过验证,仅供参考。请根据你的实际输入/输出长度、并发量和硬件配置调整 --max-model-len、--max-num-seqs、--max-num-batched-tokens 和 --gpu-memory-utilization。

  • 如果你需要使用 curl 和工具调用进行测试,请在启动命令中添加以下内容:
    --enable-auto-tool-choice \
    --tool-call-parser minimax_m2 \
    --reasoning-parser minimax_m2_append_think

A2(单节点)

sysctl -w vm.swappiness=0
sysctl -w kernel.numa_balancing=0
sysctl kernel.sched_migration_cost_ns=50000

export HCCL_BUFFSIZE=512
export HCCL_OP_EXPANSION_MODE="AIV"
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True

# Ensure the model path matches the directory recorded during download
vllm serve /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
    --served-model-name MiniMax-M2.7 \
    --host 0.0.0.0 \
    --port 8000 \
    --trust-remote-code \
    --tensor-parallel-size 8 \
    --quantization ascend \
    --enable-expert-parallel \
    --max-num-seqs 32 \
    --seed 1024 \
    --max-num-batched-tokens 32768 \
    --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY"}' \
    --gpu-memory-utilization 0.85 \
    --additional-config '{"enable_cpu_binding":true}' \
    --model-loader-extra-config '{"enable_multithread_load":true,"num_threads":16}' \
    --speculative_config '{"method": "eagle3", "model": "/path/to/weight/Eagle3/",  "num_speculative_tokens":3}'

注意:以上参数仅在特定测试环境中经过验证,仅供参考。请根据你的实际输入/输出长度、并发量和硬件配置调整 --max-model-len、--max-num-seqs、--max-num-batched-tokens 和 --gpu-memory-utilization。

  • 如果你需要使用 curl 和工具调用进行测试,请在启动命令中添加以下内容:
    --enable-auto-tool-choice \
    --tool-call-parser minimax_m2 \
    --reasoning-parser minimax_m2_append_think

5.2 多节点 PD 分离部署

PD(Prefill-Decode)分离将 Prefill 和 Decode 阶段拆分到不同节点,以获得更好的吞吐量。以下 1P1D 配置已针对使用 MiniMax-M2.7-W8A8 的 128k 输入/输出场景进行了验证。

硬件:2× Atlas 800 A3(64GB × 16),一个用于 Prefill,一个用于 Decode。

常见问题提示: 对于 PD 分离特有问题,例如 KV 传输超时或 Mooncake 连接错误,请参阅公共常见问题。对于 MiniMax 特有的 PD 分离问题,请参阅第 10 章常见问题。

首先,在每个节点上准备 launch_online_dp.py:

launch_online_dp.py

然后,在每个节点上准备 run_dp_template.sh。

Prefill 节点(将 nic_name 和 local_ip 设置为你自己的值):

unset http_proxy https_proxy ftp_proxy
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
sysctl -w vm.swappiness=0
sysctl -w kernel.numa_balancing=0
sysctl kernel.sched_migration_cost_ns=50000

nic_name="<your_nic_name>"
local_ip="<your_ip>"

export HCCL_BUFFSIZE=1024
export HCCL_IF_IP=$local_ip
export HCCL_OP_EXPANSION_MODE="AIV"
export HCCL_SOCKET_IFNAME=$nic_name
export ASCEND_RT_VISIBLE_DEVICES=$1

export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/mooncake:$LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD
export GLOO_SOCKET_IFNAME=$nic_name
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True
export PYTHONHASHSEED=0

# Ensure the model path matches the directory recorded during download
vllm serve /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
    --host 0.0.0.0 \
    --port $2 \
    --data-parallel-size $3 \
    --data-parallel-rank $4 \
    --data-parallel-address $5 \
    --data-parallel-rpc-port $6 \
    --tensor-parallel-size $7 \
    --enable-expert-parallel \
    --served-model-name minimax \
    --max-model-len 200000 \
    --max-num-batched-tokens 16384 \
    --max-num-seqs 64 \
    --trust-remote-code \
    --gpu-memory-utilization 0.75 \
    --quantization ascend \
    --enforce-eager \
    --speculative_config '{"method": "eagle3", "model": "/path/to/weight/Eagle3/", "num_speculative_tokens": 1}' \
    --additional-config '{"enable_cpu_binding":true,
                        "enable_fused_mc2":1}' \
    --kv-transfer-config \
        '{"kv_connector": "MooncakeConnectorV1",
        "kv_role": "kv_producer",
        "kv_port": "35880",
        "engine_id": "0",
        "kv_connector_extra_config": {
             "use_ascend_direct": true,
             "prefill": {"dp_size": 2, "tp_size": 8},
             "decode":  {"dp_size": 2, "tp_size": 8}
        }}'

解码节点(将 nic_name 和 local_ip 设置为您自己的值):

unset http_proxy https_proxy ftp_proxy
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
sysctl -w vm.swappiness=0
sysctl -w kernel.numa_balancing=0
sysctl kernel.sched_migration_cost_ns=50000

nic_name="<your_nic_name>"
local_ip="<your_ip>"

export HCCL_BUFFSIZE=2048
export HCCL_IF_IP=$local_ip
export HCCL_OP_EXPANSION_MODE="AIV"
export HCCL_SOCKET_IFNAME=$nic_name
export ASCEND_RT_VISIBLE_DEVICES=$1

export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/mooncake:$LD_LIBRARY_PATH
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2:$LD_PRELOAD
export GLOO_SOCKET_IFNAME=$nic_name
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True
export PYTHONHASHSEED=0

# Ensure the model path matches the directory recorded during download
vllm serve /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
    --host 0.0.0.0 \
    --port $2 \
    --data-parallel-size $3 \
    --data-parallel-rank $4 \
    --data-parallel-address $5 \
    --data-parallel-rpc-port $6 \
    --tensor-parallel-size $7 \
    --enable-expert-parallel \
    --served-model-name minimax \
    --max-model-len 200000 \
    --max-num-batched-tokens 16384 \
    --max-num-seqs 16 \
    --trust-remote-code \
    --no-enable-prefix-caching \
    --gpu-memory-utilization 0.75 \
    --quantization ascend \
    --compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY"}' \
    --speculative_config '{"method": "eagle3", "model": "/path/to/weight/Eagle3/", "num_speculative_tokens": 3}' \
    --additional-config '{"enable_cpu_binding":true,
                        "enable_fused_mc2":1}' \
    --kv-transfer-config \
        '{"kv_connector": "MooncakeConnectorV1",
        "kv_role": "kv_consumer",
        "kv_port": "56900",
        "engine_id": "1",
        "kv_connector_extra_config": {
             "use_ascend_direct": true,
             "prefill": {"dp_size": 2, "tp_size": 8},
             "decode":  {"dp_size": 2, "tp_size": 8}
        }}'

脚本准备就绪后,在每个节点上启动服务器。

预填充节点:

python launch_online_dp.py \
    --dp-size 2 --tp-size 8 \
    --dp-size-local 2 --dp-rank-start 0 \
    --dp-address <prefill_ip> --dp-rpc-port 12321 \
    --vllm-start-port 7000

解码节点:

python launch_online_dp.py \
    --dp-size 2 --tp-size 8 \
    --dp-size-local 2 --dp-rank-start 0 \
    --dp-address <decode_ip> --dp-rpc-port 12321 \
    --vllm-start-port 7100

请求转发

在能够访问两个节点的任意机器上运行代理。您可以从仓库获取代理脚本:load_balance_proxy_server_example.py。

unset http_proxy https_proxy

python load_balance_proxy_server_example.py \
    --port 8009 \
    --host <prefill_ip> \
    --prefiller-hosts \
       <prefill_ip> <prefill_ip> \
    --prefiller-ports \
       7000 7001 \
    --decoder-hosts \
       <decode_ip> <decode_ip> \
    --decoder-ports \
       7100 7101

之后,服务可通过 http://<proxy_ip>:8009 访问。

6 功能验证

服务器启动后,您可以使用输入提示词查询模型。

注意:

  • <node_ip>:运行服务器的节点 IP 地址(例如,单节点时为 localhost)。
  • <port>:服务器启动命令中指定的端口号(例如 8000)。

使用 curl

curl http://<node_ip>:<port>/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-M2.7",
    "messages": [{"role": "user", "content": "Hello, who are you?"}],
    "stream": false,
    "temperature": 0.8,
    "max_tokens": 200
  }'

预期结果:HTTP 200,JSON 响应中包含 choices 字段,其中包含模型的回复文本。

使用 OpenAI Python 客户端

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="na")

resp = client.chat.completions.create(
    model="MiniMax-M2.7",
    messages=[{"role": "user", "content": "你好,请介绍一下你自己,并展示一次工具调用的参数格式。"}],
    max_tokens=256,
)
print(resp.choices[0].message.content)

预期结果:响应应在 content 字段中包含连贯的自我介绍和工具调用参数格式。

工具调用验证

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-M2.7",
    "messages": [{"role": "user", "content": "请查询上海的天气。"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_current_weather",
        "description": "Get weather by city",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {"type": "string"},
            "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
          },
          "required": ["city"]
        }
      }
    }],
    "tool_choice": "auto",
    "temperature": 0,
    "max_tokens": 512
  }'

预期结果:HTTP 200,JSON 响应中包含 tool_calls 字段,其中包含函数名称和参数。

7 精度评估

注意:后处理参数(例如 max_tokens、temperature、stop tokens)应与模型权重中 generation_config.json 定义的参数保持一致。GPQA-diamond 和 AIME2025 的推荐最大输出长度为 64k(65536 tokens)。

以下是两种精度评估方法。

7.1 使用 AISBench

详细信息请参阅 使用 AISBench。

7.2 使用 Language Model Evaluation Harness

以 gsm8k 数据集作为示例测试数据集,在线模式下运行 MiniMax-M2.7-W8A8 的精度评估。

  1. 关于 lm_eval 的安装,请参阅 使用 lm_eval。
  2. 运行 lm_eval 执行精度评估:

blocks directly inside thecontentfield instead of separating them. If your downstream application relies on the standard reasoning semantics of/v1/responses(where the thinking process and final answer are separated), you should use--reasoning-parser minimax_m2to ensure the dedicatedreasoning` field is properly populated.

Translation: - 问:使用 minimax_m2_append_think 时,为什么 reasoning 字段经常为空?应该如何选择合适的 --reasoning-parser?

答:这是预期行为。minimax_m2_append_think 解析器会将 <think>...</think> 块直接保留在 content 字段中,而不是将其分离出来。如果您的下游应用依赖 /v1/responses 的标准 reasoning 语义(即思考过程和最终答案分离),则应使用 --reasoning-parser minimax_m2,以确保专门的 reasoning 字段被正确填充。

Hmm, "reasoning semantics" - keep "reasoning" in English since it's a field name. "标准 reasoning 语义" or "标准的 reasoning 语义". OK.

Let me double-check: "retains <think>...</think> blocks directly inside the content field instead of separating them" -> "会将 <think>...</think> 块直接保留在 content 字段中,而不是将其分离出来". The inline code <think>...</think> stays unchanged. Good.

"properly populated" -> "被正确填充" or "正确填充". Good.

Now, let me also reconsider heading translations:

  • ## 8 Performance Evaluation -> ## 8 性能评估 {#8-performance-evaluation}
  • ### 8.1 Using AISBench -> ### 8.1 使用 AISBench {#81-using-aisbench}
  • ### 8.2 Using vLLM Benchmark -> ### 8.2 使用 vLLM Benchmark {#82-using-vllm-benchmark}
  • ## 9 Performance Tuning -> ## 9 性能调优 {#9-performance-tuning}
  • ### 9.1 Recommended Configurations -> ### 9.1 推荐配置 {#91-recommended-configurations}
  • ### 9.2 Tuning Guidelines -> ### 9.2 调优指南 {#92-tuning-guidelines}
  • #### 9.2.1 General Tuning Reference -> #### 9.2.1 通用调优参考 {#921-general-tuning-reference}
  • #### 9.2.2 Model-Specific Optimizations -> #### 9.2.2 模型特定优化 {#922-model-specific-optimizations}
  • ##### Optimizations Enabled by Default -> ##### 默认启用的优化 {#optimizations-enabled-by-default}
  • ##### Optimizations That Require Explicit Enabling -> ##### 需要显式启用的优化 {#optimizations-that-require-explicit-enabling}
  • ## 10 FAQ -> ## 10 常见问题 {#10-faq}

Wait, for "## 10 FAQ" - slash: "10 FAQ" -> "10-faq". Good.

For the h4 headings "9.2.1 General Tuning Reference" - slug from original "9.2.1 General Tuning Reference". GitHub slug: lowercase, remove dots -> "921-general-tuning-reference". Yes.

Now, let me double-check the blockquote notes:

Note under 9.1 table: "> Note: The prefix cache hit rate for short-sequence tests is 0%; for long-sequence tests it is 90%. Adjust max-num-seqs, max-model-len, and max-num-batched-tokens based on your actual workload."

Translation: "> 注意:短序列测试的前缀缓存命中率为 0%,长序列测试为 90%。请根据实际工作负载调整 max-num-seqs、max-model-len 和 max-num-batched-tokens。"

Note under section 9: "> Note: The following configurations are validated in specific test environments and are for reference only. The optimal configuration depends on factors such as maximum input/output length, prefix cache hit rate, precision requirements, and deployment machine ratios. It is recommended to refer to Section 9.2 for tuning based on actual conditions."

Translation: "> 注意:以下配置已在特定测试环境中验证,仅供参考。最佳配置取决于最大输入/输出长度、前缀缓存命中率、精度要求以及部署机器配比等因素。建议根据实际条件参考第 9.2 节进行调优。"

"deployment machine ratios" - "部署机器的比例" or "部署机配比". "部署机器配比" works. Or "部署机器数量比例". I'll use "部署机器配比".

"precision requirements" - "精度要求". Good.

Now, should I use "第 9.2 节" or "9.2 节"? "refer to Section 9.2" -> "参考第 9.2 节". Good.

Let me also consider the top code block. There's no heading before it, and it starts the document. Actually, wait - looking at the original text, the code block at the top might be a continuation of section 7 or an example for a previous section. Since I only see this fragment, I keep the code block exactly as-is. No translation needed inside code.

Code block:

lm_eval \
  --model local-completions \
  --model_args model=/path/to/weight/MiniMax-M2.7-w8a8-QuaRot,base_url=http://127.0.0.1:8000/v1/completions,tokenized_requests=False,trust_remote_code=True \
  --tasks gsm8k \
  --output_path ./

Keep unchanged.

Now the vLLM benchmark code block:

export VLLM_USE_MODELSCOPE=True
vllm bench serve \
  --model /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
  --dataset-name random \
  --random-input 200 \
  --num-prompts 200 \
  --request-rate 1 \
  --save-result \
  --result-dir ./

Keep unchanged.

Now let me look at details in section 9.2.2 "Optimizations Enabled by Default" intro: "The following optimizations are enabled by default and require no additional configuration:" -> "以下优化默认启用,无需额外配置:"

Now the table headers/first table under 9.1. Let me finalize:

场景 输入/输出 部署 NPU 数量 P Config D Config 最大批处理 Token 数 最大序列数 (P/D) 最大模型长度 EAGLE3 FUSED_MC2 FlashComm1 异步调度
短序列高吞吐 3.5k → 1.5k 1P2D PD 分离 24 (A3) DP8TP2EP16 DP32TP1EP32 16384 128 / 128 32k 3 开启 开启 开启
短序列低时延 3.5k → 1.5k 1P2D PD 分离 24 (A3) DP4TP4EP16 DP8TP4EP32 16384 128 / 128 32k 3 开启 开启 开启
长序列高吞吐 128k → 1k
(90% 缓存命中)
1P1D PD 分离 16 (A3) DP2TP8EP16 DP2TP8EP16 16384 64 / 16 200k 3 开启 开启 开启
长序列低时延 128k → 1k
(90% 缓存命中)
1P2D PD 分离 24 (A3) DP2TP8EP16 DP4TP8EP32 16384 64 / 16 200k 3 开启 开启 开启

Hmm, wait. Should I translate "Short Seq High Throughput" as "短序列高吞吐"? "吞吐" (throughput) vs "高吞吐量". Both are fine. Let me use "短序列高吞吐" / "短序列低时延" / "长序列高吞吐" / "长序列低时延". Low latency -> 低时延 (common in telecom/AI) or 低延迟. 时延 is more common in Huawei/Ascend docs. Since AISBench and Ascend context, "时延" is apt.

"Max Num Seqs (P/D)" -> "最大序列数 (P/D)". Good. "Max Model Len" -> "最大模型长度". Good. "Async Scheduling" -> "异步调度". Good.

Now, should "On" be translated to "开启"? Yes.

Hmm, but wait - the values "3" under EAGLE3 - that's num_speculative_tokens. Keep as "3". "On" under FUSED_MC2, FlashComm1, Async Scheduling - "开启".

Should I keep "On" in English? In the second table, the Enablement Method uses inline code with 1 and true, and the note says "Currently disabled by default (false)". For the first table, "On" means enabled. Chinese "开启" is clear. I'll translate.

Now, one concern: the instruction says "Keep EVERY table: same number of rows, same number of columns, same separator row." My translated table has the same structure. Good. The separator row should be identical: |----------|-------------|------------|------|----------|----------|-------------------|----------------|---------------|--------|-----------|------------|------------------|. Keep.

Second table: | 优化技术 | 技术原理 | 性能收益 | | ---------------------- | ------------------- | ------------------- | | FullGraph 优化 | 使用 compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"} 一次性捕获并重放整个解码图 | 显著降低调度时延,稳定多设备性能 | | CPU 绑定 | 使用 --additional-config '{"enable_cpu_binding":true}' 绑定 CPU 核心 | 降低跨核调度开销,提升解码时延稳定性 | | 多线程权重加载 | 使用 --model-loader-extra-config '{"enable_multithread_load":true}' 并行加载权重 | 减少模型加载时间 |

Third table: | 优化技术 | 适用场景 | 启用方式 | 技术原理 | 注意事项 | | ---------------------- | -------------------- | ----------------- | ------------------- | ----------- | | Fused MC2 | TP ≥ 4 的场景 | --additional-config '{"enable_fused_mc2": 1}' | 融合多个通信和计算操作 | 推荐用于 A3;不适用于 A2 | | 均衡调度 | 高 DP 场景 | --additional-config '{"scheduler_config":{"enable_balance_scheduling":true}}' | 增强 prefill 和 decode 之间的调度能力 | 当前默认关闭(false)。仅当并发数 ≈ DP × max-num-seqs 时设置为 true。长上下文场景请禁用 | | EAGLE3 投机解码 | 所有场景 | --speculative_config '{"method": "eagle3", "model": "/path/to/Eagle3/", "num_speculative_tokens": 3}' | 使用草稿模型预测后续 token | 长上下文使用 1–3 个 token;短上下文使用 3 个 token | | jemalloc 预加载 | 所有场景 | export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2 | 替换默认内存分配器以减少内存碎片 | 确保容器中已安装 jemalloc |

Wait, careful with the inline code in the table. In the original: --additional-config '{"enable_fused_mc2": 1}' - the backticks around it. I keep them.

Also the "1–3 tokens" - the en dash –. Keep.

Now let me reconsider some translation choices:

  1. "EAGLE3 Speculative Decoding" - I translated to "EAGLE3 投机解码". But note the first table has just "EAGLE3" as a column. And the note in the precautions mentions "EAGLE3" without "Speculative Decoding". In the text, "EAGLE3 speculative decoding" appears in FAQ Q1 as well. I translated that as "EAGLE3 投机解码". Good, consistent.

  2. "Balanced Scheduling" -> "均衡调度". Hmm, but the config is enable_balance_scheduling. Chinese "均衡调度" is a reasonable translation. OK.

  3. "FullGraph Optimization" -> "FullGraph 优化". OK.

  4. "CPU Binding" -> "CPU 绑定". OK.

  5. "Multi-thread Weight Loading" -> "多线程权重加载". OK.

  6. "jemalloc Preload" -> "jemalloc 预加载". OK.

Now, let me re-examine the FAQ section. The original:

10 FAQ

For common environment, installation, and general parameter issues, please refer to the Public FAQs. This chapter only covers MiniMax-M2 (M2.5/M2.7) model-specific issues.

  • Q: Does C8 quantization support EAGLE3 speculative decoding?

A: Not yet. C8 quantization with EAGLE3 is currently unsupported.

  • Q: Which --reasoning-parser is recommended for tool calling tasks?

A: For tool calling tasks, it is recommended to use --reasoning-parser minimax_m2_append_think.

  • Q: Why is the reasoning field often empty when using minimax_m2_append_think, and how should I choose the right --reasoning-parser?

A: This is expected behavior. The minimax_m2_append_think parser retains <think>...</think> blocks directly inside the content field instead of separating them. If your downstream application relies on the standard reasoning semantics of /v1/responses (where the thinking process and final answer are separated), you should use --reasoning-parser minimax_m2 to ensure the dedicated reasoning field is properly populated.

Translation:

10 常见问题

有关常见的环境、安装和通用参数问题,请参阅公共 FAQ。本章仅涵盖 MiniMax-M2(M2.5/M2.7)模型的专属问题。

  • 问:C8 量化是否支持 EAGLE3 投机解码?

答:暂不支持。目前不支持 C8 量化与 EAGLE3 组合使用。

  • 问:对于工具调用任务,推荐使用哪个 --reasoning-parser?

答:对于工具调用任务,建议使用 --reasoning-parser minimax_m2_append_think。

  • 问:使用 minimax_m2_append_think 时,为什么 reasoning 字段经常为空?应该如何选择合适的 --reasoning-parser?

答:这是预期行为。minimax_m2_append_think 解析器会将 <think>...</think> 块直接保留在 content 字段中,而不是将其分离。如果您的下游应用依赖 /v1/responses 的标准 reasoning 语义(即思考过程和最终答案分离),则应使用 --reasoning-parser minimax_m2,以确保专门的 reasoning 字段被正确填充。

Wait - "the dedicated reasoning field" - "专门的 reasoning 字段" or "专用的 reasoning 字段". I'll use "专用的".

Also, "C8 quantization with EAGLE3 is currently unsupported" - maybe "目前尚不支持 C8 量化结合 EAGLE3 使用。" Let me refine: "暂不支持。当前不支持 C8 量化与 EAGLE3 结合使用。"

Hmm, let me reconsider "Not yet." - "暂不支持" is good.

Now let me reconsider whether to translate "Public FAQ" as "公共 FAQ" or "通用 FAQ". The document uses "Public" to mean a shared doc. In Chinese, "公共" works. The link text is "Public FAQs". I'll use "公共 FAQ". Good.

Now, let me double-check the prose in section 8:

"Refer to Using AISBench for performance evaluation for details."

Translation: "详细信息请参阅使用 AISBench 进行性能评估。"

Hmm, "for details" -> "有关详细信息,请参阅" or "详细信息请参见". I'll use "详细信息请参阅".

Actually, let me structure: "有关详细信息,请参阅使用 AISBench 进行性能评估。" That's natural.

"Run performance evaluation for MiniMax-M2.7-W8A8 as an example."

Translation: "以 MiniMax-M2.7-W8A8 为例,运行性能评估。"

Hmm, or "以下以 MiniMax-M2.7-W8A8 为例进行性能评估。" That's smoother. Let me use: "以下以 MiniMax-M2.7-W8A8 为例运行性能评估。"

"Refer to vllm benchmark for more details."

Translation: "更多详细信息,请参阅 vllm benchmark。"

"Take the serve subcommand as an example:"

Translation: "以 serve 子命令为例:"

Good.

Now section 9.2.1: "Please refer to the Public Performance Tuning Documentation for general tuning methods."

Translation: "通用调优方法请参阅公共性能调优文档。"

Hmm, "Public Performance Tuning Documentation" - "公共性能调优文档". Or "通用性能调优文档". Since "general tuning methods" is in the sentence, using "公共" avoids duplication. Keep "公共性能调优文档".

Actually, let me reconsider. The URL slug is optimization_and_tuning.md - this is a shared/commons doc. "Public" = "公共". Yes.

"Please refer to the Feature Matrix for detailed feature descriptions."

Translation: "详细的特性描述请参阅特性矩阵。"

"Feature Matrix" -> "特性矩阵". Good.

Now, let me make sure I preserve all the markdown formatting details:

  • The > **Note**: blockquotes - in the original it's > **Note**: (colon after bold Note). Actually looking: > **Note**: The following configurations.... So the bold is "Note", followed by colon. In Chinese translation: > **注意**:以下配置... Using fullwidth colon. That's appropriate for Chinese. Good.

  • The list items with - **Q:** and A: (indented). Preserve the structure.

  • The heading attr_list: use {#slug}.

Let me verify each heading's anchor once more with GitHub's algorithm (lowercase, remove punctuation except hyphens, spaces -> hyphens):

  • "8 Performance Evaluation": "8 Performance Evaluation" -> "8-performance-evaluation" ✓
  • "8.1 Using AISBench": "8.1 using aisbench" -> "81-using-aisbench" ✓
  • "8.2 Using vLLM Benchmark": "8.2 using vllm benchmark" -> "82-using-vllm-benchmark" ✓
  • "9 Performance Tuning": -> "9-performance-tuning" ✓
  • "9.1 Recommended Configurations": -> "91-recommended-configurations" ✓
  • "9.2 Tuning Guidelines": -> "92-tuning-guidelines" ✓
  • "9.2.1 General Tuning Reference": -> "921-general-tuning-reference" ✓
  • "9.2.2 Model-Specific Optimizations": -> "922-model-specific-optimizations" ✓
  • "Optimizations Enabled by Default": -> "optimizations-enabled-by-default" ✓
  • "Optimizations That Require Explicit Enabling": -> "optimizations-that-require-explicit-enabling" ✓
  • "10 FAQ": -> "10-faq" ✓

Note: "Model-Specific" - the hyphen is kept lowercase: "model-specific". Yes.

Now, let me think about whether headings should include the number in Chinese. "8 Performance Evaluation" -> "8 性能评估". Yes, keep the number "8". Similarly "8.1 使用 AISBench", "9.2 调优指南", "9.2.1 通用调优参考", "9.2.2 模型特定优化", "10 常见问题". And the h5 headings don't have numbers: "默认启用的优化", "需要显式启用的优化".

Now let me also double check the separator rows in tables. In the original, the first table's separator row is: |----------|-------------|------------|------|----------|----------|-------------------|----------------|---------------|--------|-----------|------------|------------------|

I'll keep it exactly. The number of cells: 14 columns? Let me count: Scenario, Input/Output, Deployment, NPUs, P Config, D Config, Max Batched Tokens, Max Num Seqs (P/D), Max Model Len, EAGLE3, FUSED_MC2, FlashComm1, Async Scheduling - that's 13 columns. Wait, let me count the header again:

| Scenario | Input/Output | Deployment | NPUs | P Config | D Config | Max Batched Tokens | Max Num Seqs (P/D) | Max Model Len | EAGLE3 | FUSED_MC2 | FlashComm1 | Async Scheduling |

Count: 1 Scenario, 2 Input/Output, 3 Deployment, 4 NPUs, 5 P Config, 6 D Config, 7 Max Batched Tokens, 8 Max Num Seqs (P/D), 9 Max Model Len, 10 EAGLE3, 11 FUSED_MC2, 12 FlashComm1, 13 Async Scheduling. 13 columns. The separator row: |----------|-------------|------------|------|----------|----------|-------------------|----------------|---------------|--------|-----------|------------|------------------| - count: 13. Yes. Good.

Second table separator: | ---------------------- | ------------------- | ------------------- | - 3 columns. Good.

Third table separator: | ---------------------- | -------------------- | ----------------- | ------------------- | ----------- | - 5 columns. Good.

Preserve exactly.

Now let me also think about the note in section 9.1: the table is followed by a blockquote. I need to put a blank line between the table and blockquote. In the original, there's a blank line. I'll keep.

Now, one more consideration: should "Token" in "Max Batched Tokens" be kept as "Token"? The user explicitly listed "Token" as an example of a term not to translate. So "令牌" is not allowed. "Token" stays. My translation "最大批处理 Token 数" keeps "Token". Good.

Also "tokens" in "1–3 tokens for long context" -> "1–3 个 token" - keeping "token" (singular) as un-translated term. Good.

"predict future tokens" -> "预测后续 token". Good.

Now let me reconsider "prefill and decode". Should these be translated? In Chinese ML inference docs, "prefill" and "decode" are often written in English because the standard terms are "prefill 阶段" and "decode 阶段". The document also uses "PD separation" -> "PD 分离" where P and D stand for prefill/decode. I'll keep "prefill" and "decode" in English.

Now "concurrency ≈ DP × max-num-seqs" - the ≈ symbol and inline code max-num-seqs stay. "concurrency" -> "并发数" or "并发度". "并发数" (number of concurrent requests). I'll use "并发数". So "仅当并发数 ≈ DP × max-num-seqs 时设置为 true".

Hmm, "concurrency" in vLLM context is the number of concurrent sequences/requests. "并发度" is also common. I'll use "并发数".

Now let me assemble the full translation.

Wait, one issue: the first code block at the top. It has no preceding heading in the fragment. Should I add anything? No. Just output it as-is.

Also, there might be a missing heading before that code block in the original document (like "### 7.x xxx"), but since it's not in the provided text, I don't add it.

Let me now also double-check the exact text of the top code block: it contains lm_eval \ etc. Keep byte-for-byte same.

Now let me reconsider the sentence "This chapter only covers MiniMax-M2 (M2.5/M2.7) model-specific issues." -> "本章仅涵盖 MiniMax-M2(M2.5/M2.7)模型的专属问题。" The parentheses - original uses half-width "(M2.5/M2.7)". Should I keep half-width or use fullwidth "(M2.5/M2.7)"? For consistency in Chinese text, fullwidth parentheses are typical. But the rule says keep Markdown structure and don't translate code identifiers. Parentheses are punctuation. I think fullwidth is fine for Chinese. However, to be minimal and safe, I could keep the original half-width parentheses. Hmm. Let me think about what a professional translation would do: Chinese text uses fullwidth parentheses (). But the model name "MiniMax-M2 (M2.5/M2.7)" is itself a product name. I'd keep the whole phrase as-is: "MiniMax-M2 (M2.5/M2.7)". Actually, since it's a model name string, keeping the original parentheses is safer. Let me keep it as "MiniMax-M2 (M2.5/M2.7)". Hmm, but then the Chinese sentence reads "本章仅涵盖 MiniMax-M2 (M2.5/M2.7) 模型的专属问题。" That's fine.

Similarly, in the FAQ, "C8 quantization" -> "C8 量化". "EAGLE3" stays.

Now the "Note" in section 9.2 table: "Currently disabled by default (false). Set to true only when concurrency ≈ DP × max-num-seqs. Disable for long-context scenarios" - I need to keep the inline code false and true. Good.

Also "Recommended for A3; not applicable for A2" - "推荐用于 A3;不适用于 A2". Use fullwidth semicolon ;since Chinese text. Good.

Now, let me also verify the "1P2D PD separation" translations: - "1P2D PD separation" -> "1P2D PD 分离". Hmm, in Chinese we'd write "1P2D PD分离" or "1P2D PD 分离". Space between PD and 分离? In Chinese text mixed with English, typically a space between Latin and Chinese: "PD 分离". So "1P2D PD 分离". Good.

Now, let me think about the header "Max Num Seqs (P/D)" - in Chinese: "最大序列数 (P/D)". The original has spaces around "(P/D)"? "Max Num Seqs (P/D)" - yes, there's a space before "(". In Chinese: "最大序列数 (P/D)". Good.

And "Max Model Len" -> "最大模型长度". Good.

Now let me reconsider whether to translate "vLLM benchmark" link text. The link text "vllm benchmark" - "vLLM" is a brand (product name), "benchmark" is a command/subcommand. I'll keep it as "vllm benchmark" (exact original). Good.

Hmm, actually the link text in the original is "vllm benchmark" (lowercase v). Let me re-check: "Refer to vllm benchmark for more details." Yes, "vllm benchmark". Keep as-is.

Now let me also double check the heading "### 8.2 Using vLLM Benchmark" - the vLLM in heading. Translation: "### 8.2 使用 vLLM Benchmark {#82-using-vllm-benchmark}". Keep "Using" -> "使用", "vLLM Benchmark" stays. Good.

Now, let me reconsider "Take the serve subcommand as an example:" - "以 serve 子命令为例:". Good.

Now, the blockquote note under section 9: "It is recommended to refer to Section 9.2 for tuning based on actual conditions." -> "建议根据实际条件参考第 9.2 节进行调优。" Good.

Alright, let me also check: in the original, section 9.2.2 intro has "##### Optimizations Enabled by Default" followed by "The following optimizations are enabled by default and require no additional configuration:".

Then after the first table, "##### Optimizations That Require Explicit Enabling" followed directly by the second table. There's no intro sentence before the second table, correct? Looking at the original:

"##### Optimizations That Require Explicit Enabling" immediately followed by the table. Yes, no prose between. Keep that structure.

Now, let me draft the complete output:

```shell
lm_eval \
  --model local-completions \
  --model_args model=/path/to/weight/MiniMax-M2.7-w8a8-QuaRot,base_url=http://127.0.0.1:8000/v1/completions,tokenized_requests=False,trust_remote_code=True \
  --tasks gsm8k \
  --output_path ./

8 性能评估

8.1 使用 AISBench

有关详细信息,请参阅使用 AISBench 进行性能评估。

8.2 使用 vLLM Benchmark

以 MiniMax-M2.7-W8A8 为例运行性能评估。

更多详细信息,请参阅 vllm benchmark。

以 serve 子命令为例:

export VLLM_USE_MODELSCOPE=True
vllm bench serve \
  --model /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
  --dataset-name random \
  --random-input 200 \
  --num-prompts 200 \
  --request-rate 1 \
  --save-result \
  --result-dir ./

9 性能调优

注意:以下配置已在特定测试环境中验证,仅供参考。最佳配置取决于最大输入/输出长度、前缀缓存命中率、精度要求以及部署机器配比等因素。建议根据实际条件参考第 9.2 节进行调优。

以下配置已在内部测试中验证,并按使用场景分类。

场景 输入/输出 部署 NPU 数量 P Config D Config 最大批处理 Token 数 最大序列数 (P/D) 最大模型长度 EAGLE3 FUSED_MC2 FlashComm1 异步调度
短序列高吞吐 3.5k → 1.5k 1P2D PD 分离 24 (A3) DP8TP2EP16 DP32TP1EP32 16384 128 / 128 32k 3 开启 开启 开启
短序列低时延 3.5k → 1.5k 1P2D PD 分离 24 (A3) DP4TP4EP16 DP8TP4EP32 16384 128 / 128 32k 3 开启 开启 开启
长序列高吞吐 128k → 1k
(90% 缓存命中)
1P1D PD 分离 16 (A3) DP2TP8EP16 DP2TP8EP16 16384 64 / 16 200k 3 开启 开启 开启
长序列低时延 128k → 1k
(90% 缓存命中)
1P2D PD 分离 24 (A3) DP2TP8EP16 DP4TP8EP32 16384 64 / 16 200k 3 开启 开启 开启

注意:短序列测试的前缀缓存命中率为 0%,长序列测试为 90%。请根据实际工作负载调整 max-num-seqs、max-model-len 和 max-num-batched-tokens。

9.2 调优指南

9.2.1 通用调优参考

通用调优方法请参阅公共性能调优文档。

详细的特性描述请参阅特性矩阵。

9.2.2 模型特定优化

默认启用的优化

以下优化默认启用,无需额外配置:

优化技术 技术原理 性能收益
FullGraph 优化 使用 compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"} 一次性捕获并重放整个解码图 显著降低调度时延,稳定多设备性能
CPU 绑定 使用 --additional-config '{"enable_cpu_binding":true}' 绑定 CPU 核心 降低跨核调度开销,提升解码时延稳定性
多线程权重加载 使用 --model-loader-extra-config '{"enable_multithread_load":true}' 并行加载权重 减少模型加载时间
需要显式启用的优化
优化技术 适用场景 启用方式 技术原理 注意事项
Fused MC2 TP ≥ 4 的场景 --additional-config '{"enable_fused_mc2": 1}' 融合多个通信和计算操作 推荐用于 A3;不适用于 A2
均衡调度 高 DP 场景 --additional-config '{"scheduler_config":{"enable_balance_scheduling":true}}' 增强 prefill 和 decode 之间的调度能力 当前默认关闭(false)。仅当并发数 ≈ DP × max-num-seqs 时设置为 true。长上下文场景请禁用
EAGLE3 投机解码 所有场景 --speculative_config '{"method": "eagle3", "model": "/path/to/Eagle3/", "num_speculative_tokens": 3}' 使用草稿模型预测后续 token 长上下文使用 1–3 个 token;短上下文使用 3 个 token
jemalloc 预加载 所有场景 export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2 替换默认内存分配器以减少内存碎片 确保容器中已安装 jemalloc

10 常见问题

有关常见的环境、安装和通用参数问题,请参阅公共 FAQ。本章仅涵盖 MiniMax-M2 (M2.5/M2.7) 模型的专属问题。

  • 问:C8 量化是否支持 EAGLE3 投机解码?

答:暂不支持。目前不支持 C8 量化与 EAGLE3 组合使用。

  • 问:对于工具调用任务,推荐使用哪个 --reasoning-parser?

答:对于工具调用任务,建议使用 --reasoning-parser minimax_m2_append_think。

  • 问:使用 minimax_m2_append_think 时,为什么 reasoning 字段经常为空?应该如何选择合适的 --reasoning-parser?

答:这是预期行为。minimax_m2_append_think 解析器会将 <think>...</think> 块直接保留在 content 字段中,而不是将其分离。如果您的下游应用依赖 /v1/responses 的标准 reasoning 语义(即思考过程和最终答案分离),则应使用 --reasoning-parser minimax_m2,以确保专用的 reasoning 字段被正确填充。

Hmm wait, let me reconsider a couple of things:

1. In the note under section 9: "It is recommended to refer to Section 9.2 for tuning based on actual conditions." I wrote "建议根据实际条件参考第 9.2 节进行调优。" That works.

2. "部署机器配比" - Hmm, "deployment machine ratios" - could also be "部署机配比". Let me keep "部署机器配比".

3. "NPU 数量" - I changed the header from "NPUs". Is that keeping the same number of columns? Yes, it's just a text change. But wait - is "NPUs" a term I should not translate? It's a hardware term. The example says GPU isn't translated. NPU similarly isn't translated as "神经处理单元". My translation keeps "NPU" and adds "数量". That should be fine. Actually, maybe safer to keep "NPUs" exactly? Hmm. Let me think about the spirit: "Do NOT translate ... brand/product names (e.g. Ollama, Docker, GPU...)". NPU is like GPU - a hardware type. GPU stays "GPU" in Chinese. NPU stays "NPU". But the column header "NPUs" - if I keep it as "NPUs", it's fine too. Adding "数量" clarifies the meaning. In professional Chinese docs, a column "NPU 数量" is natural. I'll keep "NPU 数量".

4. For "P Config" / "D Config" - I kept them. Should I add Chinese? "P 配置" / "D 配置"? Hmm. Let me reconsider. "Config" is a common word; the instruction doesn't forbid translating it. But "P Config" / "D Config" with values like "DP8TP2EP16" - these are configuration parameters in the inference engine. In Chinese docs, they'd likely write "P 配置" / "D 配置". Hmm. However, since the instruction says "Do NOT translate code identifiers, commands... API names" - "Config" here might refer to `--p-config`-like settings? Actually there are vLLM args like `--p-config`? No, not exactly. Hmm.

Let me think again about what's safest while being helpful. The user wants a professional translation. Mixed Chinese-English tech docs commonly keep "Config" in table headers as-is: "P Config", "D Config". Translating to "P 配置" is also fine. I'll keep "P Config" / "D Config" since they're shorthand labels tied to the engine configuration, and it avoids ambiguity.

Actually, wait. Let me reconsider "Max Batched Tokens" -> "最大批处理 Token 数". In vLLM, `max-num-batched-tokens`. "Batched Tokens" -> "批处理 Token". Good.

5. The separator row for each table must be exactly the same as the original. I preserved them.

6. Let me double-check the original separator for table 1: 
`|----------|-------------|------------|------|----------|----------|-------------------|----------------|---------------|--------|-----------|------------|------------------|`
Yes, I copied it exactly.

Table 2 separator:
`| ---------------------- | ------------------- | ------------------- |`
Table 3 separator:
`| ---------------------- | -------------------- | ----------------- | ------------------- | ----------- |`

These I copied exactly.

7. In the FAQ list, the original has:
- Q: Does C8 quantization support EAGLE3 speculative decoding?

A: Not yet. C8 quantization with EAGLE3 is currently unsupported.

The blank line between the Q and A - preserved.

8. Now, one more check: the heading levels. The original has `## 10 FAQ` directly after section 9. I have `## 10 常见问题 {#10-faq}`. Good.

9. Also, in section 9.2.2, after the first table, the sub-sub-heading is `#####`. I have `##### 需要显式启用的优化 {#optimizations-that-require-explicit-enabling}`. Good.

Now, let me reconsider the translation "目前不支持 C8 量化与 EAGLE3 组合使用。" for "C8 quantization with EAGLE3 is currently unsupported." Good.

Also "Not yet." -> "暂不支持。" Good.

One more consideration: "Which `--reasoning-parser` is recommended for tool calling tasks?" -> "对于工具调用任务,推荐使用哪个 `--reasoning-parser`?" Good.

And the answer: "For tool calling tasks, it is recommended to use `--reasoning-parser minimax_m2_append_think`." -> "对于工具调用任务,建议使用 `--reasoning-parser minimax_m2_append_think`。" Good.

Now, let me also reconsider the phrase "retains `<think>...</think>` blocks directly inside the `content` field instead of separating them". My translation: "会将 `<think>...</think>` 块直接保留在 `content` 字段中,而不是将其分离。" Good. "分离" alone might need "分离出来". Let me say "而不是将其分离出来". Better.

"where the thinking process and final answer are separated" - "(即思考过程和最终答案分离)". Good.

"you should use `--reasoning-parser minimax_m2` to ensure the dedicated `reasoning` field is properly populated" - "则应使用 `--reasoning-parser minimax_m2`,以确保专用的 `reasoning` 字段被正确填充。" Good.

Now, let me re-examine "This is expected behavior." -> "这是预期行为。" Good.

Now, let me reconsider "model-specific issues" -> "模型专属问题". Good.

Also, "common environment, installation, and general parameter issues" -> "常见的环境、安装和通用参数问题". Good.

Now, let me reconsider "Public FAQs" once more. The URL is `../../faqs.md`. It's a shared FAQ. "公共 FAQ" is fine.

Alright. Let me also double check that I haven't translated anything that should remain untranslated:
- `--model local-completions` - unchanged.
- `base_url=http://127.0.0.1:8000/v1/completions` - unchanged.
- `tokenized_requests=False` - unchanged.
- `trust_remote_code=True` - unchanged.
- `--tasks gsm8k` - unchanged.
- `export VLLM_USE_MODELSCOPE=True` - unchanged.
- `vllm bench serve` - unchanged.
- `--dataset-name random` - unchanged.
- `--random-input 200` - unchanged.
- `--num-prompts 200` - unchanged.
- `--request-rate 1` - unchanged.
- `--save-result` - unchanged.
- `--result-dir ./` - unchanged.
- `compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"}` - unchanged.
- `--additional-config '{"enable_cpu_binding":true}'` - unchanged.
- `--model-loader-extra-config '{"enable_multithread_load":true}'` - unchanged.
- `--additional-config '{"enable_fused_mc2": 1}'` - unchanged.
- `--additional-config '{"scheduler_config":{"enable_balance_scheduling":true}}'` - unchanged.
- `--speculative_config '{"method": "eagle3", "model": "/path/to/Eagle3/", "num_speculative_tokens": 3}'` - unchanged.
- `export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2` - unchanged.
- `/v1/responses` - unchanged.
- `minimax_m2_append_think`, `minimax_m2` - unchanged.
- URLs - unchanged.
- `<think>...</think>` - unchanged.
- `max-num-seqs`, `max-model-len`, `max-num-batched-tokens` - unchanged.

Good.

Now, one concern: the instruction says "for every heading append its original English anchor via attr_list". I've done that. Let me make sure the anchor uses lowercase letters and hyphens derived from the original English heading, including any numbers.

For "### 8.2 Using vLLM Benchmark" - original heading text: "8.2 Using vLLM Benchmark". Normalized: "82-using-vllm-benchmark". Good.

For "#### 9.2.2 Model-Specific Optimizations" - "922-model-specific-optimizations". Good.

For "##### Optimizations That Require Explicit Enabling" - "optimizations-that-require-explicit-enabling". Good.

Now, let me also verify the first heading "## 8 Performance Evaluation" - original: "8 Performance Evaluation" -> "8-performance-evaluation". Good.

Everything looks consistent.

Let me also reconsider whether "Async Scheduling" should be translated. It's a vLLM feature: "Async Scheduling" / "异步调度". I translated to "异步调度". Good. The column values are "On" -> "开启". Good.

Similarly "FlashComm1" - keep. "FUSED_MC2" - keep. "EAGLE3" - keep.

Now, the "Deployment" column values: "1P2D PD separation" and "1P1D PD separation". I wrote "1P2D PD 分离" and "1P1D PD 分离". Good.

Actually, let me reconsider: is "PD separation" a term meaning prefill-decode separation? Yes. "PD 分离" is standard. Good.

Now, let me double check the original text around section 9.1 note: "The prefix cache hit rate for short-sequence tests is 0%; for long-sequence tests it is 90%." -> "短序列测试的前缀缓存命中率为 0%,长序列测试为 90%。" Good.

"Adjust `max-num-seqs`, `max-model-len`, and `max-num-batched-tokens` based on your actual workload." -> "请根据实际工作负载调整 `max-num-seqs`、`max-model-len` 和 `max-num-batched-tokens`。" Good.

Now, let me think about whether "workload" should be kept in English. The instruction lists examples like "Prompt" not to translate. "workload" is not on the list. "工作负载" is the standard Chinese translation. Good.

Now, "precision requirements" - "精度要求". Hmm, "precision" could be "计算精度" (e.g., FP8, BF16, W8A8). "精度要求" is fine.

"maximum input/output length" - "最大输入/输出长度". Good.

"prefix cache hit rate" - "前缀缓存命中率". Good.

"deployment machine ratios" - "部署机器配比". Good.

Now, let me also reconsider "The following configurations are validated in internal testing and are categorized by use case." -> "以下配置已在内部测试中验证,并按使用场景分类。" Good.

Let me reconsider "categorized by use case" - "按使用场景分类". Or "按场景分类". Keep "使用场景". Good.

Now, section 8.1: "Refer to [Using AISBench for performance evaluation](../../developer_guide/evaluation/using_ais_bench.md#execute-performance-evaluation) for details."

I translate the link text: "使用 AISBench 进行性能评估". Good. The URL and anchor `#execute-performance-evaluation` unchanged.

8.2: "Run performance evaluation for `MiniMax-M2.7-W8A8` as an example." -> "以 `MiniMax-M2.7-W8A8` 为例运行性能评估。" Good.

"Refer to [vllm benchmark](https://docs.vllm.ai/en/latest/benchmarking/) for more details." -> "更多详细信息,请参阅 [vllm benchmark](https://docs.vllm.ai/en/latest/benchmarking/)。" Good.

"Take the `serve` subcommand as an example:" -> "以 `serve` 子命令为例:" Good.

Now, section 9.2.1:
"Please refer to the [Public Performance Tuning Documentation](../../developer_guide/performance_and_debug/optimization_and_tuning.md) for general tuning methods." -> "通用调优方法请参阅[公共性能调优文档](../../developer_guide/performance_and_debug/optimization_and_tuning.md)。" Good.

"Please refer to the [Feature Matrix](../../user_guide/support_matrix/feature_matrix.md) for detailed feature descriptions." -> "详细的特性描述请参阅[特性矩阵](../../user_guide/support_matrix/feature_matrix.md)。" Good.

Hmm, should these two sentences start with "请参阅" instead? My translation puts the object first. That's a natural Chinese structure. Good.

Now, section 9.2.2 intro:
"##### Optimizations Enabled by Default" -> "##### 默认启用的优化 {#optimizations-enabled-by-default}"

"The following optimizations are enabled by default and require no additional configuration:" -> "以下优化默认启用,无需额外配置:"

Now the table 2:

"FullGraph Optimization" - "FullGraph 优化". 
Technical principle: "Captures and replays the entire decoding graph at once using `compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"}`" -> "使用 `compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"}` 一次性捕获并重放整个解码图"

Hmm, "at once" - "一次性" or "一次性地". "捕获并重放" - good. Note: "replays" - "重放" is the CUDA graph terminology. Good.

Performance benefit: "Significantly reduces scheduling latency, stabilizes multi-device performance" -> "显著降低调度时延,稳定多设备性能"

"CPU Binding":
Technical principle: "Uses `--additional-config '{"enable_cpu_binding":true}'` to bind CPU cores" -> "使用 `--additional-config '{"enable_cpu_binding":true}'` 绑定 CPU 核心"
Performance benefit: "Reduces cross-core scheduling overhead, improving decode latency stability" -> "降低跨核调度开销,提升解码时延稳定性"

"Multi-thread Weight Loading":
Technical principle: "Uses `--model-loader-extra-config '{"enable_multithread_load":true}'` for parallel weight loading" -> "使用 `--model-loader-extra-config '{"enable_multithread_load":true}'` 并行加载权重"
Performance benefit: "Reduces model loading time" -> "减少模型加载时间"

Table 3:

"Fused MC2" - keep.
Applicable scenarios: "TP ≥ 4 scenarios" -> "TP ≥ 4 的场景"
Enablement method: inline code keep.
Technical principle: "Fuses multiple communication and computation operations" -> "融合多个通信和计算操作"
Precautions: "Recommended for A3; not applicable for A2" -> "推荐用于 A3;不适用于 A2"

"Balanced Scheduling" -> "均衡调度"
Applicable: "High DP scenarios" -> "高 DP 场景"
Enablement: inline code.
Technical principle: "Enhances scheduling capacity between prefill and decode" -> "增强 prefill 和 decode 之间的调度能力"
Precautions: "Currently disabled by default (`false`). Set to `true` only when concurrency ≈ DP × max-num-seqs. Disable for long-context scenarios" -> "当前默认关闭(`false`)。仅当并发数 ≈ DP × max-num-seqs 时设置为 `true`。长上下文场景请禁用"

Hmm, "Currently disabled by default (`false`)" - the parentheses around `false`. In my translation I wrote "(`false`)" with fullwidth parens. Should I keep half-width "(`false`)"? Hmm. In Chinese text, fullwidth parentheses are standard. But since the original has half-width, and this is a tech doc, keeping half-width might be safer for consistency. Actually, I used fullwidth parentheses in several places. Let me decide on a consistent approach: use fullwidth parentheses for Chinese prose where parenthetical content is inserted. This is standard in Chinese technical translation. For example, "(M2.5/M2.7)", "(`false`)", "(即思考过程和最终答案分离)". 

Hmm, but wait - "MiniMax-M2 (M2.5/M2.7)" - if I use fullwidth, it becomes "MiniMax-M2(M2.5/M2.7)". Is that OK? It changes the model name formatting slightly. The model name is "MiniMax-M2", and "(M2.5/M2.7)" is an annotation of model variants. Using fullwidth parentheses is fine typographically. 

Actually, let me reconsider. The rule says "Keep ALL ... Markdown structure unchanged. Translate ONLY prose text." Parentheses are punctuation, part of prose. Changing half-width to fullwidth is a typographic choice, not a structural change. It's acceptable. But to minimize changes, maybe keep half-width parentheses as they appear? Hmm. Professional Chinese translation typically converts half-width parentheses to fullwidth when surrounding Chinese text. But when the parenthetical content is technical (like `false`, M2.5/M2.7), half-width is often kept.

Let me go with fullwidth for pure Chinese prose parentheticals and keep half-width for technical tokens? That might be inconsistent. Let me just use fullwidth consistently for prose parentheses, and keep inline code as-is. So:
- "(M2.5/M2.7)" 
- "(`false`)"
- "(即思考过程和最终答案分离)"

Hmm wait, for the `false` one, the original is "Currently disabled by default (`false`)." I'll write "当前默认关闭(`false`)。"

Hmm, actually, now I realize the original uses "(`false`)" with half-width parens. If I write "(`false`)", the parentheses are different width. This is fine.

OK let me finalize.

Actually, let me reconsider "EAGLE3 投机解码" vs keeping "EAGLE3 Speculative Decoding". The term "speculative decoding" in Chinese AI literature is commonly translated as "投机解码" (or "推测解码"). Since "EAGLE3" is a specific method name (like a brand), and "Speculative Decoding" is a generic technique category, "EAGLE3 投机解码" is natural. Similarly, the FAQ "Does C8 quantization support EAGLE3 speculative decoding?" -> "C8 量化是否支持 EAGLE3 投机解码?" Good.

"draft model" - "草稿模型" (standard Chinese term for speculative decoding draft model). Good.

Now let me also reconsider "均衡调度" for "Balanced Scheduling". Alternatively, "平衡调度". The config key is `enable_balance_scheduling`. In vLLM Chinese docs, "平衡调度" might be used. Hmm. Both "均衡调度" and "平衡调度" are fine. Let me use "均衡调度". Actually, "平衡调度" aligns more literally with "balance_scheduling". But "均衡" is more natural for "balanced" in Chinese. I'll go with "均衡调度". Hmm, hold on - actually, let me keep it closer to the config key meaning: "平衡调度". The term "balance scheduling" -> "平衡调度" is a direct translation of "balance". "均衡调度" implies equal distribution. Both acceptable. I'll use "均衡调度".

Now, "jemalloc 预加载" - "preload" in English is "预加载". Good.

Now let me also consider: "Long Seq High Throughput" -> "长序列高吞吐". Should it be "长序列高吞吐量"? "吞吐" is fine as a shorthand. I used "短序列高吞吐" and "长序列高吞吐". Good.

"Short Seq Low Latency" -> "短序列低时延". "Long Seq Low Latency" -> "长序列低时延". Good.

Now, the code blocks: I must ensure the opening and closing fence lines are preserved. In the top code block, the fence is ```shell ... ```. Keep. The second is ```shell ... ```. Keep.

Also, the inline `<br>` in the table cell - keep.

Now, let me think about the final output format. The instruction says "Output ONLY the translated Markdown, no preamble, no code fence around the whole output." So I just output the Markdown directly.

One more thing: the original document starts with a code block. That code block seems to belong to a previous section (maybe a continuation of section 7.x evaluation commands). Since I'm translating the given fragment, I keep it.

Now, let me double-check one detail in the table 9.2.2 first table's first data row technical principle: 

"Captures and replays the entire decoding graph at once using `compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"}`"

Note: the inline code is `compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"}`. It contains double quotes inside. In Markdown, inline code with backticks handles double quotes fine. Keep exactly. My translation: "使用 `compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"}` 一次性捕获并重放整个解码图". Good.

Hmm, wait - the original sentence structure: "Captures and replays the entire decoding graph at once using `...`". I reordered to "使用 `...` 一次性捕获并重放整个解码图". Good.

Second row: "Uses `--additional-config '{"enable_cpu_binding":true}'` to bind CPU cores" -> "使用 `--additional-config '{"enable_cpu_binding":true}'` 绑定 CPU 核心". The inline code contains single quotes: `--additional-config '{"enable_cpu_binding":true}'`. Keep exactly. Good.

Third row: "Uses `--model-loader-extra-config '{"enable_multithread_load":true}'` for parallel weight loading" -> "使用 `--model-loader-extra-config '{"enable_multithread_load":true}'` 并行加载权重". Good.

Now the third table's enablement methods:
- `` `--additional-config '{"enable_fused_mc2": 1}'` `` - keep.
- `` `--additional-config '{"scheduler_config":{"enable_balance_scheduling":true}}'` `` - keep.
- `` `--speculative_config '{"method": "eagle3", "model": "/path/to/Eagle3/", "num_speculative_tokens": 3}'` `` - keep. Note this inline code contains double quotes and spaces. Keep exactly.
- `` `export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2` `` - keep.

Now, one thing: in the translated Chinese, when I have "(`false`)", the backticks inside fullwidth parentheses. That's fine.

Let me also reconsider: "Set to `true` only when concurrency ≈ DP × max-num-seqs." -> "仅当并发数 ≈ DP × max-num-seqs 时设置为 `true`。" The multiplication sign × is a typographic symbol; keep. Good.

"Disable for long-context scenarios" -> "长上下文场景请禁用". Good.

Now, let me also double check the blockquote "> **注意**:..." formatting. The original: `> **Note**: ...`. In my output: `> **注意**:...`. The bold is "注意", followed by fullwidth colon. Then space? In the original there's a space after "Note**:". In Chinese, no space after fullwidth colon. Good.

Now, let me think about whether "第 9.2 节" should be "第9.2节" without spaces. Chinese typography typically puts a space between Chinese and Latin/digits? Actually no space normally between Chinese and digits either, but "第 9.2 节" with spaces is common in tech docs to improve readability. Hmm, Chinese typesetting convention: no space between Chinese characters and adjacent digits/Latin, but many Chinese tech docs do insert spaces. Let me keep "第 9.2 节" with spaces, consistent with my other mixed-script text like "TP ≥ 4 的场景" (which has spaces).

Actually, let me reconsider. In my translations, I have "TP ≥ 4 的场景", "高 DP 场景", "P/D", "EAGLE3 投机解码". These mixed-script phrases with spaces around Latin terms are typical in Chinese tech writing. So "第 9.2 节" with spaces is fine.

Similarly, "C8 量化" - space between C8 and 量化. "EAGLE3 投机解码" - space. "M2.5/M2.7" - no Chinese adjacent. "MiniMax-M2 (M2.5/M2.7) 模型" - hmm, if I use fullwidth parens: "MiniMax-M2(M2.5/M2.7)模型" - there's no space between the closing paren and 模型. With fullwidth parens, no space is needed. With half-width, a space would be typical: "MiniMax-M2 (M2.5/M2.7) 模型". Let me decide: I'll use half-width parentheses to match the original exactly: "MiniMax-M2 (M2.5/M2.7) 模型". Hmm, but then I have a space before "(" which matches the original "(M2.5/M2.7)". Actually the original is "MiniMax-M2 (M2.5/M2.7)" with a space before "(". So I'll keep it exactly: "MiniMax-M2 (M2.5/M2.7) 模型". Wait, the original text: "MiniMax-M2 (M2.5/M2.7) model-specific issues." So the phrase in the original: "MiniMax-M2 (M2.5/M2.7)" with space before paren. Keep that. Then "模型" follows. So: "本章仅涵盖 MiniMax-M2 (M2.5/M2.7) 模型的专属问题。" That has a space between ")" and "模型". That's fine and consistent with mixed-script spacing.

Similarly for the "currently disabled by default (`false`)" - I'll keep half-width parens to match original: "当前默认关闭 (`false`)。" Hmm, but Chinese text with half-width parens: "当前默认关闭 (`false`)。" That's also acceptable. Actually, wait - the original: "Currently disabled by default (`false`)." I could translate as "当前默认关闭 (`false`)。" Hmm, mixing: after "关闭" a space then half-width paren. In Chinese tech docs, both styles appear. 

Let me make a decision: use half-width parentheses consistently when the parenthetical content is technical (contains code/numbers), and fullwidth when it's pure Chinese annotation. But honestly, for simplicity and to preserve original formatting, let me keep half-width parentheses everywhere in the translated text where the original had half-width parentheses, EXCEPT where I'm adding a Chinese parenthetical that didn't exist. For example, "(即思考过程和最终答案分离)" is my addition to explain "where the thinking process and final answer are separated". Since the original has "where ...", not a parenthetical. Hmm, actually the original has "(where the thinking process and final answer are separated)" - with half-width parens. So I should keep half-width: "(即思考过程和最终答案分离)". Let me keep half-width to match.

OK so decision: keep half-width parentheses as in the original, since these are within prose and match the original punctuation style.

So:
- "MiniMax-M2 (M2.5/M2.7) 模型"
- "当前默认关闭 (`false`)。"
- "(即思考过程和最终答案分离)"

Hmm, but for "当前默认关闭 (`false`)。", the half-width paren after Chinese char - it's fine: "当前默认关闭 (`false`)。"

Also "(90% 缓存命中)" in the table - original "(90% cache hit)" with half-width parens. Keep half-width: "(90% 缓存命中)". Good, I already planned that.

Now, let me reconsider "EAGLE3 投机解码" vs "EAGLE3 Speculative Decoding" in table 3 row name. The feature is named "EAGLE3 Speculative Decoding" in the original. If I translate to "EAGLE3 投机解码", it's a translated phrase with brand name kept. Fine.

Now, one more check: "Optimizations Enabled by Default" - I translated to "默认启用的优化". The anchor from original: "optimizations-enabled-by-default". Good.

"Optimizations That Require Explicit Enabling" -> "需要显式启用的优化". Anchor: "optimizations-that-require-explicit-enabling". Good.

Now, let me also verify I haven't missed any prose. Let me go through the original line by line:

1. ```shell ... ``` - code, keep. ✓
2. "## 8 Performance Evaluation" - heading, translated. ✓
3. "### 8.1 Using AISBench" - heading, translated. ✓
4. "Refer to [Using AISBench for performance evaluation](...) for details." - prose, translated. ✓
5. "### 8.2 Using vLLM Benchmark" - heading, translated. ✓
6. "Run performance evaluation for `MiniMax-M2.7-W8A8` as an example." - prose, translated. ✓
7. "Refer to [vllm benchmark](...) for more details." - prose, translated. ✓
8. "Take the `serve` subcommand as an example:" - prose, translated. ✓
9. ```shell ... ``` - code, keep. ✓
10. "## 9 Performance Tuning" - heading. ✓
11. "> **Note**: ..." - blockquote prose, translated. ✓
12. "### 9.1 Recommended Configurations" - heading. ✓
13. "The following configurations are validated in internal testing and are categorized by use case." - prose, translated. ✓
14. Table 1 - translated cells. ✓
15. "> **Note**: ..." - blockquote, translated. ✓
16. "### 9.2 Tuning Guidelines" - heading. ✓
17. "#### 9.2.1 General Tuning Reference" - heading. ✓
18. "Please refer to ... for general tuning methods." - prose, translated. ✓
19. "Please refer to ... for detailed feature descriptions." - prose, translated. ✓
20. "#### 9.2.2 Model-Specific Optimizations" - heading. ✓
21. "##### Optimizations Enabled by Default" - heading. ✓
22. "The following optimizations are enabled by default and require no additional configuration:" - prose, translated. ✓
23. Table 2 - translated cells. ✓
24. "##### Optimizations That Require Explicit Enabling" - heading. ✓
25. Table 3 - translated cells. ✓
26. "## 10 FAQ" - heading. ✓
27. "For common environment, installation, and general parameter issues, please refer to the [Public FAQs](../../faqs.md). This chapter only covers MiniMax-M2 (M2.5/M2.7) model-specific issues." - prose, translated. ✓
28. Three FAQ list items - translated. ✓

Everything covered.

Now, one more thought on "Performance Evaluation" heading translation. "性能评估" is standard. "性能评测" is also common. I'll use "性能评估".

"Performance Tuning" -> "性能调优". Standard. Good.

"Recommended Configurations" -> "推荐配置". Good.

"Tuning Guidelines" -> "调优指南". Good.

"General Tuning Reference" -> "通用调优参考". Good.

"Model-Specific Optimizations" -> "模型特定优化". Good.

"FAQ" -> "常见问题". Good.

Now, let me reconsider the first sentence of section 10: "For common environment, installation, and general parameter issues, please refer to the [Public FAQs](../../faqs.md)."

My translation: "有关常见的环境、安装和通用参数问题,请参阅[公共 FAQ](../../faqs.md)。"

Good. Hmm, "公共 FAQ" - maybe "通用 FAQ"? The word "Public" is used likely to mean a shared documentation (公共文档), as opposed to model-specific. "公共 FAQ" is fine.

Now, let me finalize. Let me also make sure I don't have any trailing issues like missing newlines between code blocks and headings. I'll ensure proper blank lines.

Also note: the output should not be wrapped in a code fence. So no ``` at the very beginning or end beyond those belonging to the original code blocks.

Let me write the final output carefully.

Wait, one more consideration: the original has "## 8 Performance Evaluation" immediately after the first code block. In my output, I need a blank line between the closing ``` of the code block and the heading. Actually, in the original there's a blank line. I'll include one.

Also, between "以 `serve` 子命令为例:" and the code block - there's a blank line. Keep.

Also, between the code block and "## 9 性能调优" - blank line. Keep.

Also, in section 9.1, between the intro sentence and the table - blank line. Keep.

Between the table and the note blockquote - blank line. Keep.

Between sections - blank lines. Keep.

Now, let me also make sure the list item indentation in the FAQ is preserved. The original:
- Q: Does C8 quantization support EAGLE3 speculative decoding?

A: Not yet. C8 quantization with EAGLE3 is currently unsupported.

The "A:" line is indented with two spaces. I'll keep two-space indent.

Let me write the final answer now.

Actually, let me reconsider two translation details once more:

1. "C8 quantization" - "C8 量化" - quantization is "量化". Good.

2. "the standard reasoning semantics of `/v1/responses`" - "`/v1/responses` 的标准 reasoning 语义". The word "reasoning" is a field/concept name here, not translated. Good.

3. "properly populated" - "被正确填充". Good.

4. "draft model" - "草稿模型". Good.

5. "cross-core scheduling overhead" - "跨核调度开销". Good.

6. "decoding graph" - "解码图". Good.

7. "schedule" - I used "调度" in various places. Good.

8. "Throughput" - "吞吐". Good.

9. "Low Latency" - "低时延". Good.

All right, I'm confident in the translation. Let me produce the final output.</think>```shell
lm_eval \
  --model local-completions \
  --model_args model=/path/to/weight/MiniMax-M2.7-w8a8-QuaRot,base_url=http://127.0.0.1:8000/v1/completions,tokenized_requests=False,trust_remote_code=True \
  --tasks gsm8k \
  --output_path ./

8 性能评估

8.1 使用 AISBench

有关详细信息,请参阅使用 AISBench 进行性能评估。

8.2 使用 vLLM Benchmark

以 MiniMax-M2.7-W8A8 为例运行性能评估。

更多详细信息,请参阅 vllm benchmark。

以 serve 子命令为例:

export VLLM_USE_MODELSCOPE=True
vllm bench serve \
  --model /path/to/weight/MiniMax-M2.7-w8a8-QuaRot \
  --dataset-name random \
  --random-input 200 \
  --num-prompts 200 \
  --request-rate 1 \
  --save-result \
  --result-dir ./

9 性能调优

注意:以下配置已在特定测试环境中验证,仅供参考。最佳配置取决于最大输入/输出长度、前缀缓存命中率、精度要求以及部署机器配比等因素。建议根据实际条件参考第 9.2 节进行调优。

以下配置已在内部测试中验证,并按使用场景分类。

场景 输入/输出 部署 NPUs P Config D Config 最大批处理 Token 数 最大序列数 (P/D) 最大模型长度 EAGLE3 FUSED_MC2 FlashComm1 异步调度
短序列高吞吐 3.5k → 1.5k 1P2D PD 分离 24 (A3) DP8TP2EP16 DP32TP1EP32 16384 128 / 128 32k 3 开启 开启 开启
短序列低时延 3.5k → 1.5k 1P2D PD 分离 24 (A3) DP4TP4EP16 DP8TP4EP32 16384 128 / 128 32k 3 开启 开启 开启
长序列高吞吐 128k → 1k
(90% 缓存命中)
1P1D PD 分离 16 (A3) DP2TP8EP16 DP2TP8EP16 16384 64 / 16 200k 3 开启 开启 开启
长序列低时延 128k → 1k
(90% 缓存命中)
1P2D PD 分离 24 (A3) DP2TP8EP16 DP4TP8EP32 16384 64 / 16 200k 3 开启 开启 开启

注意:短序列测试的前缀缓存命中率为 0%,长序列测试为 90%。请根据实际工作负载调整 max-num-seqs、max-model-len 和 max-num-batched-tokens。

9.2 调优指南

9.2.1 通用调优参考

通用调优方法请参阅公共性能调优文档。

详细的特性描述请参阅特性矩阵。

9.2.2 模型特定优化

默认启用的优化

以下优化默认启用,无需额外配置:

优化技术 技术原理 性能收益
FullGraph 优化 使用 compilation_config={"cudagraph_mode":"FULL_DECODE_ONLY"} 一次性捕获并重放整个解码图 显著降低调度时延,稳定多设备性能
CPU 绑定 使用 --additional-config '{"enable_cpu_binding":true}' 绑定 CPU 核心 降低跨核调度开销,提升解码时延稳定性
多线程权重加载 使用 --model-loader-extra-config '{"enable_multithread_load":true}' 并行加载权重 减少模型加载时间
需要显式启用的优化
优化技术 适用场景 启用方式 技术原理 注意事项
Fused MC2 TP ≥ 4 的场景 --additional-config '{"enable_fused_mc2": 1}' 融合多个通信和计算操作 推荐用于 A3;不适用于 A2
均衡调度 高 DP 场景 --additional-config '{"scheduler_config":{"enable_balance_scheduling":true}}' 增强 prefill 和 decode 之间的调度能力 当前默认关闭 (false)。仅当并发数 ≈ DP × max-num-seqs 时设置为 true。长上下文场景请禁用
EAGLE3 投机解码 所有场景 --speculative_config '{"method": "eagle3", "model": "/path/to/Eagle3/", "num_speculative_tokens": 3}' 使用草稿模型预测后续 token 长上下文使用 1–3 个 token;短上下文使用 3 个 token
jemalloc 预加载 所有场景 export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2 替换默认内存分配器以减少内存碎片 确保容器中已安装 jemalloc

10 常见问题

有关常见的环境、安装和通用参数问题,请参阅公共 FAQ。本章仅涵盖 MiniMax-M2 (M2.5/M2.7) 模型的专属问题。

  • 问:C8 量化是否支持 EAGLE3 投机解码?

答:暂不支持。目前不支持 C8 量化与 EAGLE3 组合使用。

  • 问:对于工具调用任务,推荐使用哪个 --reasoning-parser?

答:对于工具调用任务,建议使用 --reasoning-parser minimax_m2_append_think。

  • 问:使用 minimax_m2_append_think 时,为什么 reasoning 字段经常为空?应该如何选择合适的 --reasoning-parser?

答:这是预期行为。minimax_m2_append_think 解析器会将 <think>...</think> 块直接保留在 content 字段中,而不是将其分离出来。如果您的下游应用依赖 /v1/responses 的标准 reasoning 语义(即思考过程和最终答案分离),则应使用 --reasoning-parser minimax_m2,以确保专用的 reasoning 字段被正确填充。

  • 问:启动失败,出现 HCCL 端口冲突(地址已绑定)。应该怎么办?

答:检查是否已有其他进程占用该端口(例如 lsof -i :<port> 或 ss -tlnp | grep <port>)。如果发现端口冲突,请使用 --port 切换到其他端口,或终止占用该端口的特定进程。

  • 问:如何处理 OOM 或启动不稳定?

答:请参考上游 vLLM 指南中的内存不足故障排除。简而言之:首先降低 --max-num-seqs 和 --max-num-batched-tokens,降低 --gpu-memory-utilization(例如从 0.9 到 0.85),或减少并发请求数量。

  • 问:哪些端口必须可访问?

答:至少需要暴露服务端口(例如 8000)。对于多节点部署,还需确保 HCCL 通信端口和 DP RPC 端口可访问。

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 vl/vllm-ascend