jsjs1258/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": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "python": "3.11.14",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "hf_endpoint": "https://hf-mirror.com",
  "cann": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_key": "TP53",
  "sequence": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGTCACAGCACATGACGGAGGTTGTGAGGCGCTGCCCCCACCATGAGCGCTGCTCAGATAGCGATGG",
  "length": 184,
  "sha256": "7a04b9f1828848818c0e8c1f4c5b2f3a...",
  "padded_length": 2114,
  "alphabet": "A/C/G/T/N",
  "tokenizer": "DnaTokenizer",
  "attention_mask_sum": 184,
  "direction": "5'->3'",
  "input_ids_shape": [
    1,
    2114
  ]
}

真实推理结果

{
  "profile_logits_shape": [
    1,
    1000,
    2
  ],
  "count_logits_shape": [
    1,
    1
  ],
  "profile_logits_mean": -4.191997,
  "profile_logits_max": -3.828639,
  "count_logits_value": 3.089822,
  "profile_sample_0_5_0": [
    -4.523709,
    -4.544766,
    -4.54517,
    -4.539307,
    -4.579537
  ],
  "strand_axis": "plus/minus",
  "output_type": "profile+count factorization BPNet-style"
}

CPU-NPU 一致性

{
  "profile_max_abs_diff": 0.000471,
  "profile_mean_abs_diff": 0.000279,
  "count_max_abs_diff": 3.6e-05,
  "count_mean_abs_diff": 3.6e-05,
  "atol": 0.001,
  "rtol": 0.001,
  "passed": true
}

性能

{
  "sequence_length": 2114,
  "batch": 1,
  "dtype": "float32",
  "warmup": 3,
  "stable_runs": 10,
  "avg_ms": 13.98,
  "min_ms": 13.6,
  "max_ms": 14.41,
  "seq_per_s": 71.51,
  "bases_per_s": 151165.48,
  "device": "npu:0"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910