liucu/procapnet
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/procapnet on Ascend NPU

模型与任务

  • 模型:multimolecule/procapnet
  • Revision:8703b8aa772c754dbd87f90e074c55f25d723442
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu_available": true,
  "npu_device_name": "Ascend910_9362",
  "device_count": 2,
  "hf_endpoint": "https://hf-mirror.com",
  "multimolecule": "0.2.1",
  "python": "3.11",
  "transformers": "5.9.0"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_length": 2114,
  "vocab_size": 5,
  "alphabet": "DNA A/C/G/T/N pad_id 4, replace_U_with_T true",
  "strand": "5'->3' forward",
  "species": "human K562 ENCODE ENCSR261KBX",
  "primary_sequence_name": "p53_2114 (tumor protein p53 - ACTCCCCTGCCCT...)",
  "primary_sha256": "233616d27f86001aabc4b0f2e537ed3d0e40e96c1e50669e72cd1cb9ebf23d8a",
  "primary_seq_preview": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGTCACAGCACATGACGGAGGTTGTGAGGCGCTGCCCCCACCATGAGCGCTGCTCAGATAGCGATGG...[repeated to 2114]",
  "batch": 1,
  "dtype": "float32",
  "profile_length": 1000,
  "num_strands": 2,
  "expanded_sequences": [
    "p53_2114",
    "brca1_2114",
    "hemoglobin_2114",
    "tert_2114",
    "kras_2114",
    "cftr_2114",
    "synthetic_acgt_2114",
    "gc_rich_2114",
    "at_rich_2114",
    "n_2114"
  ]
}

真实推理结果

{
  "profile_shape": [
    1,
    1000,
    2
  ],
  "count_shape": [
    1,
    1
  ],
  "track_shape": [
    1,
    1000,
    2
  ],
  "track_stats": {
    "min": 3.942327020922676e-05,
    "max": 1.3807239532470703,
    "mean": 0.02443019673228264,
    "std": 0.08374468237161636,
    "sum": 48.860389709472656
  },
  "count_logits": [
    [
      3.909226894378662
    ]
  ],
  "count_expm1_total": 48.860389709472656,
  "profile_logits_sample_0_0": [
    -9.007062911987305,
    -6.288576602935791
  ],
  "plus_mean": 0.027916597202420235,
  "minus_mean": 0.020943790674209595,
  "device": "npu:0",
  "dtype": "torch.float32",
  "postprocess": "softmax(profile_logits reshape bx2000) * expm1(count_logits) -> track",
  "strand_axes": "dim 2 = 0 plus / 1 minus"
}

CPU-NPU 一致性

{
  "track": {
    "passed": true,
    "shape": [
      1,
      1000,
      2
    ],
    "elements": 2000,
    "max_abs_diff": 0.00012242794036865234,
    "mean_abs_diff": 3.916818679499556e-06,
    "atol": 0.0001,
    "rtol": 0.001
  },
  "profile_logits": {
    "passed": true,
    "shape": [
      1,
      1000,
      2
    ],
    "elements": 2000,
    "max_abs_diff": 0.0010380744934082031,
    "mean_abs_diff": 0.0002446066737174988,
    "atol": 0.001,
    "rtol": 0.001
  },
  "count_logits": {
    "passed": true,
    "shape": [
      1,
      1
    ],
    "elements": 1,
    "max_abs_diff": 5.984306335449219e-05,
    "mean_abs_diff": 5.984306335449219e-05,
    "atol": 0.0001,
    "rtol": 0.001
  },
  "overall_passed": true
}

性能

{
  "avg_ms_per_iter": 12.34,
  "p50_ms": 12.37,
  "throughput_seq_per_s": 81.06,
  "throughput_bases_per_s": 171355.8,
  "warmup_iters": 3,
  "stable_iters": 10,
  "batch": 1,
  "sequence_length": 2114,
  "profile_length": 1000,
  "dtype": "float32",
  "device": "npu:0",
  "synchronize": "torch.npu.synchronize before/after timing"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • PRO-cap 任务无公开固定 label 集,一致性基于 CPU-NPU 数值误差;完整精度需任务数据。

标签

#NPU #Ascend #Ascend910