MindIE Motor Configuration Auto-Generation Guide

The one-click deployment tool of MindIE Motor can "convert deployment scripts from the vllm-ascend community into Motor deployment configurations", reducing operational costs and ensuring consistency with downstream inference engine configurations.

Configuration examples for commonly deployed models are prepared in the same-level directory, for example: DeepSeek v4 flash model configuration example

Directory Introduction

The configuration generation scripts are stored in the examples/deployer/config_tool/ directory. The functions of each file are as follows.

examples/deployer/config_tool/
├── vllm_to_motor.py                    # Configuration conversion script
├── run_dp_template_hybrid.sh           # User paste: vLLM-ascend hybrid startup script
├── run_dp_template_prefill.sh          # User paste: vLLM-ascend P instance startup script
├── run_dp_template_decode.sh           # User paste: vLLM-ascend D instance startup script
└── output_config/                      # Generated Motor configuration content
    ├── user_config.json
    └── env.json

Precautions

  1. When performing step 2 of the usage method [Find the model deployment script in the vllm-ascend community], ensure that the vllm-ascend version in the deployment image is consistent with the community version, to avoid applying new configurations to old code.

  2. The generated Motor configuration provides only one feasible model sharding example. Users can adjust the number of servers occupied by the service and the model sharding strategy based on the number of cluster servers. When adjusting the model sharding strategy, pay attention to the following parameters.

    Configuration ItemValue TypeValue RangeDescription
    p_instances_numint≥ 1Number of Prefill instances.
    d_instances_numint≥ 1Number of Decode instances.
    single_p_instance_pod_numint≥ 1Number of Pods into which one P instance is split.
    single_d_instance_pod_numint≥ 1Number of Pods into which one D instance is split.
    p_pod_npu_numint≥ 1, up to 16 cards per PodNumber of NPU cards used by each P Pod.
    d_pod_npu_numint≥ 1, up to 16 cards per PodNumber of NPU cards used by each D Pod.
    data_parallel_sizeint≥ 1Data parallelism (DP) size.
    tensor_parallel_sizeint≥ 1Tensor parallelism (TP) size.

    Number of NPU cards occupied by one P instance = single_p_instance_pod_num (number of Pods occupied, across how many machines) × p_pod_npu_num (number of NPUs occupied by each Pod) = data_parallel_size × tensor_parallel_size

  3. The generated Motor configuration only supports successful deployment of basic inference services. Motor feature adjustments (for example, active/standby switchover, KV affinity scheduling, and service rate limiting) require users to modify the configuration manually.

  4. Single-container PD disaggregation and single-container PD aggregation scenarios are not supported currently.

  5. When deploying with Docker or Kubernetes, if the model typical configuration requires --ipc=host (for example, DeepSeek-V4.1-Flash A3), Add "MOTOR_ENABLE_IPC_HOST": 1 to motor_common_env in the generated env.json; when not configured, it is disabled by default, and the configuration generator does not add this field automatically. Slurm deployment does not require configuring this switch. For details, see deployer environment variable configuration.

Usage

  1. Enter the main directory of the configuration script.

    cd examples/deployer/
  2. Find the deployment script in the vllm-ascend community.

    Go to the vllm-ascend model deployment guide URL, select the corresponding document based on the model, and find the model deployment script (usually named run_dp_template.sh) in the Online Service Deployment section of the document (usually Section 5). Focus on the PD-aggregated deployment script (with the subsection title Single-Node Online Deployment) and the PD-disaggregated deployment script (with the subsection title Multi-Node PD-disaggregated Deployment).

    Example:

See the dsv4 flash deployment guide.

- Under the "A3 series" subsection title in Section 5.1 is the **PD-aggregated deployment script**, whose content is as follows:

  ```bash
  export OMP_PROC_BIND=false
  export OMP_NUM_THREADS=10
  ...

  vllm serve /root/.cache/modelscope/hub/models/vllm-ascend/DeepSeek-V4-Flash-w8a8-mtp \
      --max-model-len 1048576 \
      --max-num-batched-tokens 10240 \
      ...
  ```

- The script content of "run_dp_template.sh" in Section 5.2.1 is the **PD-disaggregated deployment script**. Take the P instance script as an example:

  ```bash
  nic_name="xxxx" # change to your own nic name
  local_ip=xx.xx.xx.1 # change to your own ip

  export HCCL_IF_IP=$local_ip
  export GLOO_SOCKET_IFNAME=$nic_name
  ...

  vllm serve /root/.cache/modelscope/hub/models/vllm-ascend/DeepSeek-V4-Flash-w8a8-mtp \
      --host 0.0.0.0 \
      --port $2 \
      ...
  ```

>[!NOTE] Note
>In the scenario where one instance occupies multiple servers, the vllm-ascend community may provide multiple scripts for deploying one instance (corresponding to multiple servers respectively). There is no obvious difference in the configuration of these deployment scripts, and you only need to focus on one of them.
>
>For example: In Section 5.2 of the [qwen3-235B model deployment guide](https://github.com/vllm-project/vllm-ascend/blob/main/docs/source/tutorials/models/Qwen3-235B-A22B.md#52-multi-node-pd-separation-deployment), both Decode node 0 and Decode node 1 exist. When using them, select either one as the D instance deployment script.
  1. Copy the vllm-ascend model deployment script to the examples/deployer/config_tool/ directory.

    The run_dp_template_prefill.sh, run_dp_template_decode.sh, and run_dp_template_hybrid.sh files are used to save the vllm-ascend deployment scripts. These files are all saved in the examples/deployer/config_tool/ directory.

    • Scenario 1: Deploy the PD disaggregation service through Motor.

      No additional modification is required. Directly copy the PD disaggregation deployment script from the URL above into the run_dp_template_prefill.sh (P node) and run_dp_template_decode.sh (D node) files.

    • Scenario 2: Deploy a PD aggregation service through Motor.

      No additional modification is required. Directly copy the PD aggregation deployment script from the URL above into the run_dp_template_hybrid.sh file.

  2. Generate the Motor configuration.

    Based on the scenario, run the following command to directly generate the Motor configuration:

    # PD disaggregation, Atlas 800I A2.
    python3 deploy.py --mode general_config  --deploy-scenario separate --hardware-type A2
    # PD aggregation, Atlas 800I A2.
    python3 deploy.py --mode general_config  --deploy-scenario hybrid --hardware-type A2
    # PD disaggregation, Atlas 800I A3.
    python3 deploy.py --mode general_config --deploy-scenario separate --hardware-type A3
    # PD aggregation, Atlas 800I A3.
    python3 deploy.py --mode general_config  --deploy-scenario hybrid --hardware-type A3
    # PD disaggregation, Ascend 950PR products.
    python3 deploy.py --mode general_config --deploy-scenario separate --hardware-type A5
    # PD aggregation, Ascend 950PR products
    python3 deploy.py --mode general_config --deploy-scenario hybrid --hardware-type A5
  3. View the result and fine-tune it.

    Enter the output_config directory to view the generated user_config.json and env.json files.

    cd examples/deployer/config_tool/output_config && ls

    The following content in the user_config.json file must be manually filled in by the user based on the actual situation:

    {
      "version": "v2.0",
      "motor_deploy_config": {
        ...
        "image_name": "<Manually fill in the image name>",
        ...
        "weight_mount_path": "<Fill in the access path of the model weight file based on the actual situation>"
      },
      ...
      "motor_engine_prefill_config": {
        ...
        "engine_config": {
          ...
          "model": "<Fill in the access path of the model weight file based on the actual situation>",
          ...
        }
      },
      "motor_engine_decode_config": {
        ...
        "engine_config": {
          ...
          "model": "<Fill in the access path of the model weight file based on the actual situation>",
          ...
        }
      }
    }

    The env.json file does not need to be modified. At this point, the configuration file generation is complete.