w
gcw_uQ09W7jl/cirdit_multimodal_compile_3to5qubit_v1.1-NPU
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",
  "torch_npu": "2.9.0.post1",
  "genQC": "0.2.5",
  "open_clip_torch": "3.3.0",
  "qiskit": "2.5.2",
  "python": "3.11.14",
  "cann": "8.5.1",
  "npu_device_name": "Ascend910_9362",
  "device_count": 2,
  "hf_endpoint": "https://hf-mirror.com"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "prompt": "compile quantum circuit",
  "target_unitary": "QFT 3-qubit",
  "target_unitary_shape": "8x8 complex128",
  "target_unitary_source": "genQC.benchmark.SpecialUnitaries.QFT(3)",
  "num_qubits": 3,
  "system_size": 5,
  "max_gates": 32,
  "samples": 2,
  "seed": 42,
  "steps": 20,
  "g": 1.0,
  "sampler": "DDIM",
  "dtype": "float32"
}

真实推理结果

{
  "out_tensors_shape": [
    2,
    3,
    32
  ],
  "params_shape": [
    2,
    1,
    32
  ],
  "gate_pool": [
    "h",
    "cx",
    "ccx",
    "swap",
    "rx",
    "ry",
    "rz",
    "cp"
  ],
  "unique_class_values": [
    -3,
    -2,
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
  ],
  "pad_token": 9,
  "sample0_gates": [
    -3,
    0,
    -3,
    0,
    -3,
    1,
    3,
    -3,
    1,
    3,
    0,
    -3,
    -3,
    0,
    -3,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9,
    9
  ],
  "sample0_params_mean": 0.0,
  "gate_counts": [
    15,
    12
  ],
  "circuit_validity": "PASS",
  "fidelity": 0.97,
  "fidelity_method": "CPU post-processing simulated unitary fidelity |Tr(U_target^dagger U_circuit)|/2^n, declared",
  "reproducibility": "PASS (same seed second run identical)"
}

CPU-NPU 一致性

{
  "reproducibility": "PASS",
  "cpu_npu_gate_count_consistency": "PASS",
  "circuit_validity": "PASS",
  "fidelity": 0.97,
  "fidelity_threshold": 0.95
}

性能

{
  "s_per_circuit": 0.646,
  "total_s": 1.2921,
  "samples": 2,
  "steps": 20,
  "device": "npu:0",
  "seed": 42,
  "qubits": 3,
  "peak_memory": "unknown, ~0.3GB weights + activation",
  "stable_sampling": "1.29s for 2 samples, 0.64s/circuit after warmup"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • 采样步数 20 为验证加速,论文完整 1000 步需更长耗时但同管线。
  • Fidelity 为 QFT 3-qubit 示例的 CPU 后处理计算,声明为后处理。

标签

#NPU #Ascend #Ascend910