z
zhangyuge147/multimolecule-deepcpgdna-smallwood2014-2i-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/deepcpgdna-smallwood2014-2i on Ascend NPU

模型与任务

  • 模型:multimolecule/deepcpgdna-smallwood2014-2i
  • Revision:646ae5817a52f8da18622583a02e48d047dda217
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "npu_available": true,
  "device_count": 2,
  "device_name": "Ascend910_9362",
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_length": 1001,
  "batch": 2,
  "sequence_1_sha256": "f8f15f3762978b8afb41e908fb03f5382f056c12d4677d09b2bdafd807798a7d",
  "sequence_1_source": "synthetic-construct-ACGT-repeat",
  "sequence_1_preview": "ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT",
  "vocab": {
    "A": 0,
    "C": 1,
    "G": 2,
    "T": 3,
    "N": 4
  },
  "tokenization": "DnaTokenizer 1-mer, ACGT->0-3, N->4"
}

真实推理结果

{
  "logits_shape": [
    2,
    12
  ],
  "logits_dtype": "torch.float32",
  "probs_sample_seq0": [
    0.6534858345985413,
    0.6497829556465149,
    0.6401048302650452
  ],
  "methylation_tracks": [
    0,
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11
  ],
  "id2label": {
    "0": "BS24_1_2I",
    "1": "BS24_2_2I",
    "2": "BS24_4_2I",
    "3": "BS24_6_2I",
    "4": "BS24_8_2I",
    "5": "BS25_10_2I",
    "6": "BS25_2_2I",
    "7": "BS25_6_2I",
    "8": "BS25_7_2I",
    "9": "BS25_8_2I",
    "10": "BS26_1_2I",
    "11": "BS26_2_2I"
  }
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.0008001327514648438,
  "mean_abs_diff": 0.00038397093885578215,
  "atol": 0.001,
  "rtol": 0.001,
  "passed": true,
  "pearson": 0.9999998807907104,
  "metric": "logits allclose + Pearson"
}

性能

{
  "first_compile_ms": 2.891713287681341,
  "stable_mean_ms": 2.935173874720931,
  "stable_throughput_sequences_per_s": 681.3906382940107,
  "stable_throughput_bases_per_s": 682072.0289323047,
  "batch": 2,
  "sequence_length": 1001,
  "dtype": "float32",
  "device": "npu:0"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910