waylong/cirdit_multimodal_compile_3to5qubit_v1.1
模型介绍
文件和版本
Pull Requests
讨论
分析

Floki00/cirdit_multimodal_compile_3to5qubit_v1.1 在 Ascend NPU 上

模型与任务

  • 模型:Floki00/cirdit_multimodal_compile_3to5qubit_v1.1
  • Revision:bd2c968349d0915580b5acbaf970d2fc446d2503
  • 适配路线:quantum-circuit-compilation
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "npu_available": true,
  "cann": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "h_shape": [
    2,
    5,
    32
  ],
  "h_dtype": "int64",
  "h_sha256_prefix": "64db5b137cd8b31d",
  "w_shape": [
    2,
    1,
    32
  ],
  "t_h": [
    84,
    239
  ],
  "t_w": [
    74,
    870
  ],
  "c_emb_shape": [
    2,
    37,
    512
  ],
  "U_shape": [
    2,
    2,
    32,
    32
  ],
  "seq_len": 32,
  "num_qubits": 5,
  "batch": 2,
  "seed": 42,
  "description": "synthetic random circuit tokens 0-11 mapped to unique gate values, continuous params uniform"
}

真实推理结果

{
  "output_shape": [
    2,
    5,
    32,
    16
  ],
  "output_dtype": "float32",
  "output_device": "npu:0",
  "mean": -1.01e-05,
  "std": 1.155,
  "sample_out": [
    -0.7414,
    0.4611,
    -0.1389,
    0.2014,
    1.1795
  ],
  "pred_tokens_shape": [
    2,
    5,
    32
  ],
  "pred_params_shape": [
    2,
    1,
    32
  ]
}

CPU 与 NPU 一致性

{
  "max_diff": 0.000602,
  "mean_diff": 1.39e-05,
  "cos_sim": 1.0,
  "threshold": 0.001,
  "status": "PASS"
}

性能

{
  "first_run_ms": 567.6,
  "embed_ms": 89.15,
  "stable_avg_ms": 33.7,
  "min_ms": 33.08,
  "max_ms": 34.01,
  "throughput_circuit_per_s": 59.3,
  "gates_per_s": 1899,
  "batch": 2,
  "seq_len": 32,
  "warmup": 3,
  "stable_iters": 10,
  "synchronize": true
}

自验证截图

智能体工作流

NPU 设备调用

模型结果

三张图片均由 xterm.js 根据本次真实日志生成。

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • 量子电路编译模型非传统生物序列,但已按序列生成路线完成 NPU 适配与一致性验证。

标签

#NPU #Ascend #Ascend910