本目录是 NVIDIA Alpamayo-1.5-10B(Vision-Language-Action 自动驾驶策略模型) 在昇腾 NPU 上的交付推理入口。
11078526194)Alpamayo1_5
vlm.* 前缀)。UnicycleAccelCurvatureActionSpace,加速度 + 曲率动作空间,10Hz × 6.4s)。本脚本只使用逻辑设备 npu:0,不会检查或修改物理可见性
(ASCEND_RT_VISIBLE_DEVICES 由工作容器统一设置)。每次运行都会打印:
INPUT_DEVICE=npu:0
MODEL_DEVICE=npu:0
OUTPUT_DEVICE=npu:0
CPU_FALLBACK=falseCPU 回退被明确禁止:模型、输入与输出均保持在 npu:0 上。
在任务根目录执行(inference.py 通过自身路径解析 model/、qwen3vl/,
从任意工作目录运行均可):
python delivery/inference.py交付验证阶段(2026-08-21)实际使用的固定解释器命令(exit_code=0,
耗时 24.817s,见 delivery/command.json 的
duration_seconds=24.81734312700428):
/srv/model-pipeline/jobs/.control-evidence/dependency-envs/4bc1957faa5774a7316e3f10a40833d64bda7cf1a0fb4bb1ba77607325047530/bin/python /srv/model-pipeline/jobs/Alpamayo-1.5-10B/delivery/inference.py该解释器对应 requirements.lock.txt 的
sha256=4bc1957faa5774a7316e3f10a40833d64bda7cf1a0fb4bb1ba77607325047530;
其中 transformers==4.57.1,torch/torch_npu 由固定 Ascend 工作镜像提供。
脚本依次:
INPUT_DEVICE=npu:0、MODEL_DEVICE=npu:0、
OUTPUT_DEVICE=npu:0、CPU_FALLBACK=false);model/ 以 local_files_only=True 加载 Alpamayo1_5 权重;qwen3vl/ 以 local_files_only=True 构建 Qwen3-VL 处理器
(替换被门控的 nvidia/Cosmos-Reason2-8B,vlm.* 权重全部在
checkpoint 内);torch.manual_seed(0))的确定性合成输入跑一次 smoke 推理,
断言主输出驻留 npu:0;INPUT_SEQUENCE=(聊天模板后的输入 token 数),以及由真实
推理结果导出的任务语义标记 GENERATED_TEXT=(chain-of-causation 文本)、
FORECAST=(末端航点位置)、ACTION=(末端航点旋转)与状态 JSON。delivery/
inference.py # NPU 推理入口
requirements.txt # 运行依赖(不含 torch / torch_npu)
README.md # 本说明
screenshot_request.json # 真实截图采集请求(由可信截图器执行)
clean_run.log # 交付 smoke 推理的干净运行日志
model/ # Alpamayo1_5 权重、config.json 与 LICENSE
qwen3vl/ # 本地 Qwen3-VL 后端(config/tokenizer/processor)
alpamayo_src/ # 经审计的 alpamayo1_5 源码(固定 commit 审计)
assets/ # 随包分发的模型信息资产(截图由可信截图器生成)attn_implementation 被固定为 sdpa,避免在昇腾 NPU 上使用
flash_attention_2。bfloat16;昇腾 910 不支持 fp64,全程使用 bf16。alpamayo1_5 远程代码;交付时随包携带并经过固定 commit 审计,
运行时不依赖 trust_remote_code=True 在线拉取。OpenMDW-1.1(详见模型仓库 LICENSE)。
可信截图器将在正式交付阶段生成并校验以下三张真实截图;当前仅声明规范路径,
不伪造图片(采集请求见 screenshot_request.json,本阶段不创建任何 PNG):
assets/agent_workflow.pngassets/npu_device_call.pngassets/model_result.pngtransformers==4.57.1,其余依赖版本已在 requirements.txt 中精确固定;
torch/torch_npu 由固定 Ascend 工作镜像提供,不列入 requirements。npu:0 初始化视觉语言模型与动作专家。使用任务内固定种子和合成四相机输入运行 python delivery/inference.py,检查设备标记、输出张量形状及无 CPU 回退。
python delivery/inference.py 在昇腾 NPU(逻辑设备 npu:0)上,使用固定种子
torch.manual_seed(0) 与合成四相机输入执行一次 smoke 推理。每次运行都会打印
设备契约标记与下列任务语义标记(全部由真实推理结果导出,禁止 CPU 回退):
INPUT_DEVICE=npu:0
MODEL_DEVICE=npu:0
OUTPUT_DEVICE=npu:0
CPU_FALLBACK=false
TEST_INPUT=synthetic_multicamera_4x4
INPUT_SEQUENCE=<输入 token 数>
OUTPUT_SHAPE=[1,1,1,64,3]
GENERATED_TEXT=<chain-of-causation 文本>
FORECAST=[<末端航点 xyz>]
ACTION=[<末端航点 3×3 旋转>]
{...状态 JSON...}
path string is NULLpath string is NULL
EXIT_CODE=0各标记说明与权威实测值(同一固定种子 seed=0 的真实 NPU 交付运行,全部引自
delivery/clean_run.log,SHA-256
b4158d0102b9b4b58ae750ef6a66719bcb35d0ff04808d7fa9888993695fd005):
INPUT_SEQUENCE:聊天模板后的输入 token 数。实测 3086
(与 npu_unpatched/inputs.npz 的 tokenized_data_input_ids 形状 (1, 3086) 一致)。GENERATED_TEXT:VLM 生成的链式因果文本。实测
Stop due to a lack of visible road ahead。FORECAST:64 航点未来轨迹的末端位置(xyz)。实测
[21.816919326782227, -0.3076627850532532, 0.0]。ACTION:末端航点的 3×3 旋转矩阵(动作输出)。实测
[[0.9998952150344849, 0.014478195458650589, 0.0], [-0.014478195458650589, 0.9998952150344849, 0.0], [0.0, 0.0, 1.0]]。finite=true 表示主输出张量无 NaN/Inf;
policy_outputs_shape=[1,1,1,64,3]、actions_shape=[1,1,1,64,3,3],
forecast_final/action_final 与上述 FORECAST/ACTION 逐字一致。权威交付运行的 delivery/clean_run.log 真实记录(SHA-256
b4158d0102b9b4b58ae750ef6a66719bcb35d0ff04808d7fa9888993695fd005,820 字节)为:
INPUT_DEVICE=npu:0
MODEL_DEVICE=npu:0
OUTPUT_DEVICE=npu:0
CPU_FALLBACK=false
INPUT_SEQUENCE=3086
TEST_INPUT=synthetic_multicamera_4x4
OUTPUT_SHAPE=[1,1,1,64,3]
GENERATED_TEXT=Stop due to a lack of visible road ahead
FORECAST=[21.816919326782227, -0.3076627850532532, 0.0]
ACTION=[[0.9998952150344849, 0.014478195458650589, 0.0], [-0.014478195458650589, 0.9998952150344849, 0.0], [0.0, 0.0, 1.0]]
{"action_final": [[0.9998952150344849, 0.014478195458650589, 0.0], [-0.014478195458650589, 0.9998952150344849, 0.0], [0.0, 0.0, 1.0]], "actions_shape": [1, 1, 1, 64, 3, 3], "cot_sample": ["Stop due to a lack of visible road ahead"], "finite": true, "forecast_final": [21.816919326782227, -0.3076627850532532, 0.0], "policy_outputs_shape": [1, 1, 1, 64, 3], "status": "ok"}
path string is NULLpath string is NULL
EXIT_CODE=0该日志由隔离 NPU 执行器以同一固定命令(python delivery/inference.py)重新生成,
delivery/command.json 记录 started_at=2026-08-21T16:22:11Z、
ended_at=2026-08-21T16:22:36Z、duration_seconds=24.81734312700428、
exit_code=0。尾随的 path string is NULL 为昇腾运行时卸载阶段的噪声输出,
不影响 EXIT_CODE=0 与 status=ok。
performance/performance_results.json(warmup=2、repeat=5、
synchronized=true)实测 5 次同步 rollout 延迟:
| 指标 | 实测值 |
|---|---|
| mean | 2217.046 ms |
| median | 2207.538 ms |
| p90 | 2243.553 ms |
| min | 2199.030 ms |
| max | 2259.609 ms |
| std | 22.527 ms |
原始序列(ms):2259.609, 2199.030, 2219.470, 2207.538, 2199.583。
npu_unpatched/stage_evidence.json:fixed_seed=0、repeat_count=2,
两次前向(同一固定种子)的
max_abs_diff_across_forwards = 0.0;cpu_fallback=false、
model_device=npu:0、output_device=npu:0。
本适配经明确授权跳过超出有界运行时的 10B CPU 基线。现有证据证明 Ascend NPU 功能、设备驻留、重复执行与性能,不声明 CPU/NPU 跨硬件数值等价。
以下图片由真实 Model Agent 对话记录、npu-smi 设备日志和最终 NPU 推理日志
以无头浏览器渲染生成;每张 PNG 均有同名 .provenance.json,记录源证据哈希。


