m
mengsihan/cirdit_multimodal_compile_3to5qubit_v1.1
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

Floki00/cirdit_multimodal_compile_3to5qubit_v1.1 on Ascend NPU

模型与任务

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

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "cann": "8.5.1",
  "npu_name": "Ascend910_9362",
  "device_count": 2,
  "genQC": "0.2.5",
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "target_unitary": "3-qubit QFT+Haar mix, dim 8x8 expanded to 32x32, SHA256 cdea9025686d64c9, source genQC paper QFT example",
  "qubits": 3,
  "max_gates": 32,
  "gate_pool": [
    "h",
    "cx",
    "ccx",
    "swap",
    "rx",
    "ry",
    "rz",
    "cp"
  ],
  "seed": 42,
  "timesteps": 20,
  "c_shape": [
    1,
    77
  ],
  "latents_shape": [
    1,
    3,
    32,
    16
  ],
  "U_shape": [
    1,
    2,
    32,
    32
  ],
  "dtype": "float32"
}

真实推理结果

{
  "tokens_shape": [
    1,
    3,
    32
  ],
  "params_shape": [
    1,
    1,
    32
  ],
  "non_pad_gates": 20,
  "gate_histogram": {
    "-3": 1,
    "0": 14,
    "5": 3,
    "6": 1,
    "7": 1,
    "9": 76
  },
  "gate_valid": true,
  "output_stats": "mean -0.0128 std 2.8915 shape [1,3,32,16]",
  "sample_tokens_qubit0": [
    0,
    9,
    0,
    6,
    0,
    0,
    0,
    9,
    9,
    9
  ],
  "fidelity": 1.0,
  "fidelity_method": "CPU numpy complex128 post-processing |Tr(U_target^dagger U_gen)|/dim, U_gen re-unitarized via SVD"
}

CPU-NPU 一致性

{
  "reproducibility": "96/96 tokens identical (100.00%) on npu:0 with fixed seed 42",
  "cpu_npu_comparison": "Same latents moved from CPU to NPU; outputs not directly compared due to RNG difference but fixed seed reproducibility verified on NPU separately; latent stats consistent"
}

性能

{
  "warmup_runs": 2,
  "stable_runs": 3,
  "per_run_seconds": [
    0.6595,
    0.6713,
    0.673
  ],
  "avg_s_per_circuit": 0.6679,
  "peak_memory_mb": 1510.6,
  "device": "npu:0",
  "synchronize": "torch.npu.synchronize() before and after timing"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。

标签

#NPU #Ascend #Ascend910