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..3f630ef6a9559c79099d44e2fbb608289ad11f89--- /dev/null+++ b/vllm_ascend/deployment/__init__.py@@ -0,0 +1,3 @@+# SPDX-License-Identifier: Apache-2.0++"""Task-specific deployment entrypoints."""diff --git a/vllm_ascend/deployment/qwen3_30b_a3b.py b/vllm_ascend/deployment/qwen3_30b_a3b.pynew file mode 100644index 0000000000000000000000000000000000000000..a2d78af2fd7fc828383c2579f36161da922ce892--- /dev/null+++ b/vllm_ascend/deployment/qwen3_30b_a3b.py@@ -0,0 +1,110 @@+# SPDX-License-Identifier: Apache-2.0++"""Optimized two-device deployment for Qwen3-30B-A3B on Ascend 910B."""++from __future__ import annotations++import argparse+import json+import os+import sys+from pathlib import Path+++MODEL_ID = "Qwen/Qwen3-30B-A3B"+MAX_DEVICES = 2+MAX_MODEL_LEN = 4096+MAX_NUM_BATCHED_TOKENS = 16384+MAX_NUM_SEQS = 64++ADDITIONAL_CONFIG = {+ # Keep BF16 weights in the NPU-native blocked layout used by matmuls.+ "weight_nz_mode": 2,+}+COMPILATION_CONFIG = {+ "cudagraph_mode": "FULL_DECODE_ONLY",+ "cudagraph_capture_sizes": [8, 16, 32, 64],+}+++def parse_args(argv: list[str] | None = None) -> argparse.Namespace:+ """Parse the fixed host-to-framework deployment interface."""+ parser = argparse.ArgumentParser()+ 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", required=True)+ parser.add_argument("--port", required=True, type=int)+ parser.add_argument("--device-ids", required=True)+ parser.add_argument("--runtime-dir", required=True, type=Path)+ return parser.parse_args(argv)+++def server_argv(args: argparse.Namespace) -> list[str]:+ """Build the vLLM server command for the task's fixed workload."""+ device_ids = tuple(item for item in args.device_ids.split(",") if item)+ if not 1 <= len(device_ids) <= MAX_DEVICES:+ raise ValueError(f"expected one or two device IDs, got {args.device_ids!r}")+ if any(not item.isdecimal() for item in device_ids):+ raise ValueError(f"device IDs must be nonnegative integers: {device_ids!r}")+ if len(set(device_ids)) != len(device_ids):+ raise ValueError(f"device IDs must be unique, got {args.device_ids!r}")+ if args.served_model_name != MODEL_ID:+ raise ValueError(+ f"served model must be {MODEL_ID!r}, got {args.served_model_name!r}"+ )+ if not args.runtime_dir.is_dir():+ raise ValueError(f"runtime directory does not exist: {args.runtime_dir}")++ return [+ sys.executable,+ "-B",+ "-m",+ "vllm.entrypoints.cli.main",+ "serve",+ args.model_path,+ "--tokenizer",+ args.tokenizer_path,+ "--served-model-name",+ args.served_model_name,+ "--host",+ args.host,+ "--port",+ str(args.port),+ "--dtype",+ "bfloat16",+ "--max-model-len",+ str(MAX_MODEL_LEN),+ "--tensor-parallel-size",+ str(len(device_ids)),+ "--enable-expert-parallel",+ "--distributed-executor-backend",+ "mp",+ "--gpu-memory-utilization",+ "0.60",+ "--max-num-seqs",+ str(MAX_NUM_SEQS),+ "--max-num-batched-tokens",+ str(MAX_NUM_BATCHED_TOKENS),+ "--enable-chunked-prefill",+ "--no-enable-prefix-caching",+ "--generation-config",+ "vllm",+ "--additional-config",+ json.dumps(ADDITIONAL_CONFIG, separators=(",", ":")),+ "--compilation-config",+ json.dumps(COMPILATION_CONFIG, separators=(",", ":")),+ "--disable-log-stats",+ "--disable-uvicorn-access-log",+ ]+++def main() -> None:+ """Replace this supervisor with the configured foreground API server."""+ args = parse_args()+ argv = server_argv(args)+ os.execv(sys.executable, argv)+++if __name__ == "__main__":+ main()