Claude Opus 5 · Serving

S11 · vLLM MoE

Valid

vLLM Ascend Qwen3-30B-A3B MoE system serving 2dev · Joint Optimization

1.01×PERFORMANCE RATIO
105TOOL EVENTS
1TEXT PATCHES
0BINARY NAMES

01 / PROCESS MAP

Tool activity

Each row shows one agent’s tool events in its own recorded order. Colors show broad activities; bar widths do not represent duration.

Main agentClaude Opus 5 · 105 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
52Inspect
6Edit
29Validate
14Execute
4Other

02 / EVENT SEQUENCE

Event timeline

Requests are grouped by agent, activity and topic. Delegations open into child branches. Summaries describe visible requests; tool errors and missing responses are flagged. A recorded response does not establish command success or a performance improvement.

Show event timelineHide event timeline76 groups · 105 calls

Scroll within this panel to view all events. Command sketches retain familiar programs and options. Values become <val> or <n>; paths, addresses and script bodies are hidden as <path>, <url> and <script>.

Main agent

  1. Inspect · Source & workspace

    Requested workspace inspection and file and log inspection related to source & workspace.

    1 call · #0001–#0001

    echo <val>ls -l -a <path> <n> > <path>head -n <n>
  2. Inspect · Task requirements

    Requested workspace inspection and file and log inspection related to task requirements.

    1 call · #0002–#0002

    ls -d <path> <path> <path> <n> > <path>find <path> -maxdepth <n> -name <val> <n> > <path>head -n <n>
  3. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0003–#0003

    ls -l -a <path>
  4. Inspect · Task requirements

    Requested file and log inspection and workspace inspection related to task requirements.

    4 calls · #0004–#0007

    Read <path>cd <path>ls -l -a <val> <val> <val> <val> <val> <path><command> <args>cat <val>
  5. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0008–#0008

    Read <path>
  6. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0009–#0009

    Read <path>
  7. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0010–#0010

    Read <path>
  8. Inspect · Device memory

    Requested runtime inspection, file and log inspection and workspace inspection related to device memory.

    1 call · #0011–#0011

    npu-smi info <n> >& <path>head -n <n>echo <flag>ls <path>
  9. Inspect · Source & workspace

    Requested script or workload execution, workspace inspection and file and log inspection related to source & workspace.

    4 calls · #0012–#0015

    which <val>python3 -Vls <path> <n> > <path>headpython3 -c <script> <n> >& <path>tail -n <n>
    10 more command sketches
    ls -l -a <path>echo <flag>find <path> -maxdepth <n> -name <val> -o -maxdepth <n> -name <path> -o <args>head -n <n>git log --oneline <flag>cat <path> <n> > <path>cd <path>git log --oneline <flag> <args>cat <val>echo <val>
  10. Other · Task requirements

    Requested script or workload execution related to task requirements.

    1 call · #0016–#0016

    cd <path>python3 - <script>
  11. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0017–#0017

    cat <path>
  12. Inspect · Device memory

    Requested workspace inspection, file and log inspection and script or workload execution related to device memory.

    1 call · #0018–#0018

    ls <path> <n> > <path>headecho <flag>python3 -c <script> <n> >& <path>head -n <n>npu-smi info -l <n> >& <path>
  13. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0019–#0019

    Write <path>
  14. Inspect · Source & workspace

    1 tool error

    Requested workspace inspection, environment setup or inspection and file and log inspection related to source & workspace.

    2 calls · #0020–#0021

    cd <path>ls <val> <path> <path> <n> > <path><command> <args>env <vars> bash <script> <n> >& <path>tail -n <n>
  15. Edit · Task requirements

    Requested workspace file updates, workspace inspection and code edits related to task requirements.

    1 call · #0022–#0022

    mkdir -p <path>cp <path> <path> <path>ls -l -a <path>sed -i <path> <path><command> <args>env <vars> bash <script> <n> >& <path>
    1 more command sketches
    tail -n <n>
  16. Other · Parallelism & communication

    Requested environment setup or inspection and source searches related to parallelism & communication.

    1 call · #0023–#0023

    envgrep -E <val>sort
  17. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0024–#0024

    Write <path>
  18. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0025–#0025

    ls -l -a <path> <path>
  19. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0026–#0026

    Write <path>
  20. Validate · Benchmark & validation setup

    Requested workspace file updates, script or workload execution and execution waits related to benchmark & validation setup.

    1 call · #0027–#0027

    cd <path>chmod <val> <path>nohup <val> <path> <val> <val> > <path> <n> >& <path>echo <val> <val>sleep <n>tail -n <n> <path>
    1 more command sketches
    ls <path>
  21. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0028–#0028

    cd <path>sed -n <val> <path>
  22. Validate · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0029–#0029

    tail -n <n> <path> <n> > <path>echo <val>tail -n <n> <path>
  23. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0030–#0031

    cd <path>grep -n <val> <path>head -n <n>grep -E <val>sed <path>
  24. Validate · Benchmark & validation setup

    Requested file and log inspection, workspace inspection and runtime inspection related to benchmark & validation setup.

    2 calls · #0032–#0033

    tail -n <n> <path> <n> > <path>echo <val>ls <path>wc -l <path>ps <val>grep -c <val>
    1 more command sketches
    date -u
  25. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0034–#0035

    cd <path>grep -n <val> <path>head -n <n>grep -r -n <val> <path>
  26. Validate · Benchmark & validation setup

    Requested execution waits and file and log inspection related to benchmark & validation setup.

    1 call · #0036–#0036

    sleep <n>tail -n <n> <path>
  27. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0037–#0038

    cd <path>grep -r -n <val> <path>head -n <n>echo <val>grep -n <val> <path>grep -r -n <val> --include <path> <path>
    1 more command sketches
    grep -v <val>
  28. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0039–#0039

    tail -n <n> <path>
  29. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0040–#0040

    Read <path>
  30. Validate · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0041–#0041

    tail -n <n> <path>date -uecho <val>
  31. Inspect · Source & workspace

    Requested workspace inspection, environment setup or inspection and source searches related to source & workspace.

    2 calls · #0042–#0043

    cd <path>ls <path> <path>echo <val>ls <path>envgrep -i <val>
    5 more command sketches
    echo <flag>find <path> -maxdepth <n> -name <val> -type <val> <n> > <path>headpython3 -c <script> <n> >& <path>tail -n <n>
  32. Validate · Benchmark & validation setup

    Requested file and log inspection and script or workload execution related to benchmark & validation setup.

    1 call · #0044–#0044

    cat <path> <n> > <path>python3 -c <script> <n> >& <path>tail -n <n>tail -n <n> <path>
  33. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0045–#0045

    Write <path>
  34. Validate · Benchmark & validation setup

    Requested workspace file updates, script or workload execution and execution waits related to benchmark & validation setup.

    1 call · #0046–#0046

    cd <path>rm -rf <path>nohup <val> <path> <val> <val> > <path> <n> >& <path>sleep <n>tail -n <n> <path>
  35. Inspect · Batching & scheduling

    Requested source searches and file and log inspection related to batching & scheduling.

    1 call · #0047–#0047

    grep -r -n <val> <path> <path>head -n <n>
  36. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    1 call · #0048–#0048

    cd <path>grep -r -n <val> --include <path> <path>head -n <n>
  37. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0049–#0049

    sed -n <val> <path>
  38. Validate · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0050–#0050

    tail -n <n> <path>date -u
  39. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0051–#0052

    grep -r -n <val> <path> <path> <path> <n> > <path>head -n <n>sed -n <val> <path>
  40. Validate · Device memory

    Requested source searches and file and log inspection related to device memory.

    1 call · #0053–#0053

    grep -i -E <val> <path>tail -n <n>date -u
  41. Validate · Benchmark & validation setup

    Requested script or workload execution, source searches and file and log inspection related to benchmark & validation setup.

    2 calls · #0054–#0055

    cd <path>python3 - <script>grep -i -E <val> <path>tail -n <n>echo <val>wc -l < <path>
    1 more command sketches
    date -u
  42. Validate · Device memory

    Requested source searches and file and log inspection related to device memory.

    1 call · #0056–#0056

    grep -i -E <val> <path>tail -n <n>date -u
  43. Inspect · Source & workspace

    Requested source searches related to source & workspace.

    1 call · #0057–#0057

    cd <path>grep -n <val> -A <n> <path>
  44. Validate · Device memory

    Requested runtime inspection, file and log inspection and source searches related to device memory.

    1 call · #0058–#0058

    npu-smi info -t <val> <n> >& <path>head -n <n>echo <val>grep -i -E <val> <path>tail -n <n>date -u
  45. Validate · Benchmark & validation setup

    Requested execution waits, file and log inspection and script or workload execution related to benchmark & validation setup.

    2 calls · #0059–#0060

    sleep <n>tail -n <n> <path>echo <val>python3 - <script>date -umkdir -p <path>
    2 more command sketches
    cd <path>nohup <val> <path> <val> <val> > <path> <n> >& <path>
  46. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0061–#0061

    sed -n <val> <path>
  47. Inspect · Speculative decoding

    Requested source searches and file and log inspection related to speculative decoding.

    1 call · #0062–#0062

    grep -n <val> <path>head -n <n>
  48. Execute · Benchmark & validation setup

    Requested source searches and file and log inspection related to benchmark & validation setup.

    1 call · #0063–#0063

    grep <flag> <args>grep -i -E <val> <path> <n> > <path>tail -n <n>date -u
  49. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    1 call · #0064–#0064

    cd <path>echo <val>grep -r -n <val> --include <path> <path>head -n <n>grep -v <val>
  50. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0065–#0065

    Write <path>
  51. Execute · Benchmark & validation setup

    Requested source searches, file and log inspection and execution waits related to benchmark & validation setup.

    3 calls · #0066–#0068

    grep -i -E <val> <path> <n> > <path>tail -n <n>date -usleep <n>grep <flag> <args>
  52. Inspect · Batching & scheduling

    Requested script or workload execution related to batching & scheduling.

    1 call · #0069–#0069

    cd <path>timeout <n> <val> <val> <script>
  53. Execute · Benchmark & validation setup

    1 tool error

    Requested file and log inspection, source searches and execution waits related to benchmark & validation setup.

    2 calls · #0070–#0071

    tail -n <n> <path> <n> > <path>grep <flag> <args>tail -n <n>date -usleep <n>head -c <n>
    3 more command sketches
    echols <path> <n> > <path>echo <val>
  54. Execute · Batching & scheduling

    Requested script or workload execution related to batching & scheduling.

    1 call · #0072–#0072

    python3 - <script>
  55. Inspect · Precision & numerical checks

    Requested file and log inspection, script or workload execution and source searches related to precision & numerical checks.

    1 call · #0073–#0073

    cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v -E <val>tail -n <n>
  56. Inspect · Runtime processes

    Requested workspace file updates, file and log inspection and script or workload execution related to runtime processes.

    1 call · #0074–#0074

    cd <path>mkdir -p <path>cat > <path> <script>cp <path> <path>python3 -c <script>ls <path>
  57. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0075–#0075

    date -upython3 -c <script>
  58. Validate · Benchmark & validation setup

    Requested script or workload execution, execution waits and file and log inspection related to benchmark & validation setup.

    3 calls · #0076–#0078

    cd <path><command> <args>nohup <path> <val> <val> > <path> <n> >& <path>echo <val>sleep <n>tail -n <n> <path> <n> > <path>
    8 more command sketches
    echo <flag>ls -d <path> <n> > <path>tail -n <n>pgrep <flag> <args>head -n <n>ls -l -a <path>cat <path>ls <path> <n> > <path>
  59. Inspect · Source & workspace

    Requested file and log inspection and workspace inspection related to source & workspace.

    1 call · #0079–#0079

    cat <path>echo <path>ls -R <path> <n> > <path>head -n <n>echo <val>ls -l -a <path>
  60. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0080–#0080

    cd <path><script> <args>echo <val>
  61. Inspect · Source & workspace

    Requested workspace inspection and file and log inspection related to source & workspace.

    1 call · #0081–#0081

    cd <path>ls <path> <n> > <path>echo <val>find <val> -path <val> -name <path>head -n <n>
  62. Validate · Benchmark & validation setup

    Requested file and log inspection and runtime inspection related to benchmark & validation setup.

    1 call · #0082–#0082

    tail -n <n> <path> <n> > <path>echo <val>pgrep -c -f <val> <n> > <path>wc -l <path>
  63. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0083–#0084

    cd <path>grep -n <val> <path>head -n <n>Read <path>
  64. Validate · Benchmark & validation setup

    Requested file and log inspection, source searches and runtime inspection related to benchmark & validation setup.

    6 calls · #0085–#0090

    tail -n <n> <path> <n> > <path>echo <val>cd <path>grep -r -n <val> <path> --include <path>grep -v <val>head -n <n>
    12 more command sketches
    headpgrep -c -f <val>ls -l -a <path> <n> > <path>date -ucat <path> <n> > <path>echotail -n <n> <path>python3 -c <script> <n> >& <path><command> <args>sleep <n>tail -n <n>python3 - <script>
  65. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0091–#0091

    python3 - <script>
  66. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0092–#0092

    python3 - <script>
  67. Execute · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0093–#0093

    cd <path><script> <args>echo <val>
  68. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    1 call · #0094–#0094

    cd <path>grep -n <val> -A <n> <path>head -n <n>echo <val>grep -v <val> <path>grep <path>
  69. Validate · Benchmark & validation setup

    Requested source searches and file and log inspection related to benchmark & validation setup.

    1 call · #0095–#0095

    cd <path>echo <val>grep -o <val> <path> <n> > <path>sortuniq -csort <flag>
    5 more command sketches
    headecho <path>grep -i -E <val> <path> <n> > <path>sed <path>head -n <n>
  70. Execute · Benchmark & validation setup

    Requested script or workload execution and file and log inspection related to benchmark & validation setup.

    1 call · #0096–#0096

    date -upython3 -c <script>echo <val>tail -n <n> <path> <n> > <path>
  71. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0097–#0098

    cd <path>echo <val>grep -r -n <val> <path>head -n <n>grep -r -n <val> <path> --include <path>grep -v <val>
    4 more command sketches
    grep -n <val> <path>headsed -n <val> <path>grep -n <val>
  72. Execute · Benchmark & validation setup

    Requested file and log inspection and source searches related to benchmark & validation setup.

    1 call · #0099–#0099

    cd <path>sed -n <val> <path>echo <val>date -utail -n <n> <path> <n> > <path>grep <flag> <args>
    1 more command sketches
    cut <flag>
  73. Inspect · Speculative decoding

    Requested source searches and file and log inspection related to speculative decoding.

    2 calls · #0100–#0101

    cd <path>echo <val>grep -n -E <val> <path>head -n <n>sed -n <val> <path>grep -r -n <val> <path>
    2 more command sketches
    grep -n <val> <flag> <args>grep <flag> <args>
  74. Execute · Task requirements

    Requested workspace file updates, file and log inspection and source searches related to task requirements.

    1 call · #0102–#0102

    cp <path> <path>echo <val>date -utail -n <n> <path> <n> > <path>grep <flag> <args>tail -n <n>
    2 more command sketches
    tail -n <n> <path>cut <flag>
  75. Execute · Benchmark & validation setup

    Requested environment setup or inspection, execution waits and file and log inspection related to benchmark & validation setup.

    1 call · #0103–#0103

    env <vars><command> <args>sleep <n>date -uecho <val>tail -n <n> <val> <n> > <path>
  76. Execute · Batching & scheduling

    Requested script or workload execution, source searches and file and log inspection related to batching & scheduling.

    2 calls · #0104–#0105

    python3 - <script>echo <path>grep <flag> <args>sed <path>tail -n <n>

03 / CANDIDATE ARTIFACT

Text patches & binary names

Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.

vllm_ascend · 2 changed files

Base commit: 7c254c14e2f2db1185d739075ee3cdc1da3cfde2

diff --git a/vllm_ascend/deployment/__init__.py b/vllm_ascend/deployment/__init__.pynew file mode 100644index 0000000000000000000000000000000000000000..f6b908ec7803b9512c46e24f35addf88f23077f7--- /dev/null+++ b/vllm_ascend/deployment/__init__.py@@ -0,0 +1,16 @@+#+# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.+# This file is a part of the vllm-ascend project.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+#     http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+"""Framework-owned serving deployments."""diff --git a/vllm_ascend/deployment/qwen3_30b_a3b.py b/vllm_ascend/deployment/qwen3_30b_a3b.pynew file mode 100644index 0000000000000000000000000000000000000000..ad6d0ebbf333c7abac03e6867d6cc7462ef42e80--- /dev/null+++ b/vllm_ascend/deployment/qwen3_30b_a3b.py@@ -0,0 +1,231 @@+#+# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.+# This file is a part of the vllm-ascend project.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+#     http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+"""Framework-owned serving deployment for Qwen3-30B-A3B on two Ascend NPUs.++The host invokes this module with a fixed outer ABI::++    python -B -m vllm_ascend.deployment.qwen3_30b_a3b \+        --model-path PATH --tokenizer-path PATH \+        --served-model-name Qwen/Qwen3-30B-A3B \+        --host 127.0.0.1 --port PORT --device-ids ID0,ID1 --runtime-dir PATH++The ABI fixes only the host interaction surface. This module owns the+framework-local execution plan: process graph, device placement, the+TP/DP/EP plan, batching, scheduling, graph capture, cache and memory+strategy.++Design notes+------------+The module delegates to the in-tree vLLM OpenAI server CLI rather than+re-implementing a serving loop. That keeps the process group, foreground+behaviour, ``SIGTERM`` child teardown and port release identical to the+reference launch path, which the deployment contract requires, while+leaving the engine plan fully under this module's control.++Every tuned setting below is chosen to leave per-token arithmetic+unchanged (same dtype, same TP/EP layout, same kernels, same reduction+order), because the service must reproduce token-exact greedy output.+Only scheduling, batching, graph-capture and memory sizing are altered.+"""++from __future__ import annotations++import argparse+import json+import os+import sys++# Engine plan. Values here are framework-internal; the outer ABI does not+# constrain them.+#+# Numerics-preserving rationale for each entry:+#+# * ``dtype``/``max_model_len``/TP/EP -- kept at the model's BF16 plan with+#   two-way tensor parallel and expert parallel over the same group, so the+#   per-token reduction order and kernel selection are unchanged.+# * ``max_num_batched_tokens`` -- raised from 8192 to 16384. The+#   shifted-prefill profile admits 32 x 2048-token prompts at once, i.e.+#   65536 queued prefill tokens. A 16384-token budget halves the number of+#   chunked-prefill steps (8 -> 4) for that wave, which raises MoE grouped+#   GEMM efficiency and halves the per-step collective and scheduler+#   launch overhead. Each token's result is independent of how many other+#   tokens share its batch, so this changes throughput, not output.+# * ``gpu_memory_utilization`` -- raised from 0.60 to 0.75 so the larger+#   activation peak of a 16384-token batch does not come out of the KV+#   cache. The reference plan already sizes 152k KV tokens, far above the+#   ~68k the heaviest profile holds resident, so this is headroom, not a+#   behavioural change.+# * ``cudagraph_capture_sizes`` -- densified across the decode range. The+#   decode profile runs at 64 concurrent requests but the running batch+#   dips as waves retire; the reference set {8,16,32,64} forces a batch of+#   e.g. 40 to pad up to 64 or fall out of the captured path. Padding rows+#   are dummy tokens that do not enter any real token's result, so denser+#   capture removes launch overhead without touching arithmetic.+# * prefix caching stays off. The formal input audit shows every request+#   has a distinct leading prefix and the block size is 128, so no block+#   would ever be shared; enabling it would only add hashing cost.+ENGINE_PLAN: dict[str, object] = {+    "dtype": "bfloat16",+    "max_model_len": 4096,+    "tensor_parallel_size": 2,+    "enable_expert_parallel": True,+    "gpu_memory_utilization": 0.75,+    "max_num_seqs": 64,+    "max_num_batched_tokens": 16384,+    "enable_chunked_prefill": True,+    "enable_prefix_caching": False,+    "generation_config": "vllm",+    "compilation_config": {+        "cudagraph_mode": "FULL_DECODE_ONLY",+        "cudagraph_capture_sizes": [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64],+    },+}+++def parse_args(argv: list[str] | None = None) -> argparse.Namespace:+    """Parse the fixed outer deployment ABI.++    Args:+        argv: Argument vector to parse, defaulting to ``sys.argv[1:]``.++    Returns:+        The parsed deployment arguments.+    """+    parser = argparse.ArgumentParser(+        prog="vllm_ascend.deployment.qwen3_30b_a3b",+        description="Qwen3-30B-A3B two-device Ascend serving deployment.",+    )+    parser.add_argument("--model-path", required=True)+    parser.add_argument("--tokenizer-path", required=True)+    parser.add_argument("--served-model-name", required=True)+    parser.add_argument("--host", default="127.0.0.1")+    parser.add_argument("--port", type=int, required=True)+    parser.add_argument("--device-ids", required=True)+    parser.add_argument("--runtime-dir", required=True)+    return parser.parse_args(argv)+++def device_ids(raw: str) -> list[int]:+    """Normalise the ``--device-ids`` value.++    Args:+        raw: Comma-separated device id list from the outer ABI.++    Returns:+        The parsed device ids, in the order given.++    Raises:+        ValueError: If no device id is present, or more than two are given.+    """+    ids = [int(item) for item in raw.split(",") if item != ""]+    if not 1 <= len(ids) <= 2:+        raise ValueError(+            f"deployment accepts one or two devices, received {raw!r}"+        )+    return ids+++def apply_environment(devices: list[int]) -> None:+    """Pin the framework processes to the assigned devices.++    Args:+        devices: Device ids this deployment may use.+    """+    os.environ["ASCEND_RT_VISIBLE_DEVICES"] = ",".join(map(str, devices))+    os.environ.setdefault("VLLM_PLUGINS", "ascend")+++def serve_argv(args: argparse.Namespace, devices: list[int]) -> list[str]:+    """Build the engine launch vector for the framework-local plan.++    Args:+        args: Parsed outer deployment arguments.+        devices: Device ids this deployment may use.++    Returns:+        The ``vllm serve`` argument vector implementing ``ENGINE_PLAN``.+    """+    plan = dict(ENGINE_PLAN)+    plan["tensor_parallel_size"] = len(devices)+    argv = [+        "vllm",+        "serve",+        args.model_path,+        "--tokenizer",+        args.tokenizer_path,+        "--served-model-name",+        args.served_model_name,+        "--host",+        args.host,+        "--port",+        str(args.port),+        "--dtype",+        str(plan["dtype"]),+        "--max-model-len",+        str(plan["max_model_len"]),+        "--tensor-parallel-size",+        str(plan["tensor_parallel_size"]),+        "--gpu-memory-utilization",+        str(plan["gpu_memory_utilization"]),+        "--max-num-seqs",+        str(plan["max_num_seqs"]),+        "--max-num-batched-tokens",+        str(plan["max_num_batched_tokens"]),+        "--generation-config",+        str(plan["generation_config"]),+        "--compilation-config",+        json.dumps(plan["compilation_config"], separators=(",", ":")),+    ]+    if plan["enable_expert_parallel"]:+        argv.append("--enable-expert-parallel")+    argv.append(+        "--enable-chunked-prefill"+        if plan["enable_chunked_prefill"]+        else "--no-enable-chunked-prefill"+    )+    argv.append(+        "--enable-prefix-caching"+        if plan["enable_prefix_caching"]+        else "--no-enable-prefix-caching"+    )+    return argv+++def main(argv: list[str] | None = None) -> int:+    """Run the deployment in the foreground until terminated.++    Args:+        argv: Argument vector to parse, defaulting to ``sys.argv[1:]``.++    Returns:+        The engine process exit status.+    """+    args = parse_args(argv)+    devices = device_ids(args.device_ids)+    apply_environment(devices)+    os.makedirs(args.runtime_dir, exist_ok=True)++    from vllm.entrypoints.cli.main import main as vllm_cli_main++    # The vLLM CLI reads its own argument vector. Handing the plan over this+    # way reuses the reference launch path's process-group, foreground and+    # SIGTERM teardown semantics, which the deployment contract requires.+    sys.argv = serve_argv(args, devices)+    return vllm_cli_main() or 0+++if __name__ == "__main__":+    raise SystemExit(main())