liucu/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
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "python": "3.11.14",
  "cann": "8.5.1",
  "model_dir": "/opt/atomgit/.cache/huggingface/hub/models--Floki00--cirdit_multimodal_compile_3to5qubit_v1.1/snapshots/bd2c968349d0915580b5acbaf970d2fc446d2503",
  "dtype": "float32",
  "revision": "bd2c968349d0915580b5acbaf970d2fc446d2503"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "route": "regulatory-sequence",
  "model_type": "UnitaryCLIPPartialNoiseCompilationCirDiT",
  "alphabet": "gate_pool [h,cx,ccx,swap,rx,ry,rz,cp] + pad 9, parametrized_tokens [5,6,7,8]",
  "strand": "5'->3' (circuit forward)",
  "sequence_length": 32,
  "batch": 1,
  "hidden": 768,
  "primary_sequence_name": "compile_4qubit_QFT_32gates",
  "primary_sequence": "compile 4-qubit QFT unitary with 5 qubits max, 32 gates",
  "tokens_preview": [
    1,
    0,
    5,
    6,
    2,
    3,
    1,
    0
  ],
  "pad_constant": 9,
  "num_of_qubits": 5,
  "max_gates": 32,
  "primary_sha256": "d39ae682514427a8",
  "all_sequences": {
    "qft4_32gates": {
      "length": 32,
      "sha256": "d39ae682514427a8",
      "preview": "compile 4-qubit QFT unitary with 5 qubits max, 32 gates"
    }
  },
  "source": "genQC paper arXiv:2506.01666, config.yaml gate_pool"
}

真实推理结果

{
  "output_shape": [
    1,
    32,
    768
  ],
  "output_dtype": "float32",
  "output_device": "npu:0",
  "mean": -0.0008218078874051571,
  "first_val": 0.005477089900523424,
  "max": 0.06903687119483948,
  "pred_tokens_first10": [
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7,
    7
  ],
  "total_params": 191362984,
  "num_blocks_core": 12,
  "heads_core": 16
}

CPU-NPU 一致性

{
  "passed": true,
  "max_abs_diff": 1.862645213620468e-08,
  "mean_abs_diff": 2.835988e-09,
  "corr": 1.0,
  "atol": 0.01,
  "rtol": 0.01,
  "shape": [
    1,
    32,
    768
  ],
  "elements": 24576
}

性能

{
  "single_infer_ms": 0.344,
  "avg_ms": 0.3,
  "min_ms": 0.275,
  "max_ms": 0.344,
  "seq_per_s": 3332.27,
  "bases_per_s": 106632.64,
  "input_length": 32,
  "batch_size": 1,
  "dtype": "float32",
  "device": "npu:0",
  "warmup": 3,
  "stable_runs": 10,
  "peak_memory_mb": 66.2,
  "first_compile_ms": 0.344
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • 原模型为量子电路编译 diffusion-transformer,非典型生物序列模型;本次以 regulatory-sequence 路线代理序列生成验证,实际输入为电路 token 序列(类比生物序列)。

标签

#NPU #Ascend #Ascend910