gcw_6a3w2yXz/enformer
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/enformer on Ascend NPU

模型与任务

  • 模型:multimolecule/enformer
  • Revision:20daa9146973633a4a0d8afbd9aa93e9efa41de6
  • 适配路线:long-context-tracks
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "npu_available": true,
  "device_count": 2,
  "device_name": "Ascend910_9362",
  "model_dir": "/opt/atomgit/.cache/huggingface/hub/models--multimolecule--enformer/snapshots/20daa9146973633a4a0d8afbd9aa93e9efa41de6",
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGTCACAGCACATGACGGAGGTTGTGAGGCGCTGCCCCCACCATGAGCGCTGCTCAGATAGCGATGG repeated to 196608",
  "sequence_length": 196608,
  "batch": 1,
  "alphabet": "A/C/G/T/N",
  "sha256": "570ca7c4d769e5dddd25c35221261071354bc6df072f90a18f33bfe1d1968c2a",
  "note": "196608bp DNA window padded/repeated from TP53 example, bin ~128bp, center-cropped to 896 bins"
}

真实推理结果

{
  "logits_shape": [
    1,
    896,
    5313
  ],
  "coverage_shape": [
    1,
    896,
    5313
  ],
  "logits_dtype": "torch.float32",
  "logits_device": "npu:0",
  "coverage_device": "npu:0",
  "logits_finite": true,
  "logits_sample_bin0_tracks0_4": [
    -1.606483817100525,
    -1.1174805164337158,
    -0.14852160215377808,
    -1.6704849004745483,
    -1.2556835412979126
  ],
  "logits_sample_mid": [
    -1.6043163537979126,
    -1.114427089691162,
    -0.15598085522651672,
    -1.6833404302597046,
    -1.2519948482513428
  ],
  "coverage_sample_bin0": [
    0.18281452357769012,
    0.28299829363822937,
    0.6216411590576172,
    0.17240235209465027,
    0.25066614151000977
  ],
  "species": "human",
  "bin_size": 128,
  "expected_shape": [
    1,
    896,
    5313
  ]
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.018692,
  "mean_abs_diff": 0.000378,
  "pearson": 1.0,
  "threshold_max": 0.5,
  "threshold_mean": 0.05,
  "threshold_pearson": 0.99,
  "passed": true,
  "finite_ok": true,
  "shape_ok": true,
  "device_ok": true
}

性能

{
  "first_latency_ms": 478.0438,
  "avg_latency_ms": 138.4728,
  "min_ms": 137.5387,
  "max_ms": 139.1754,
  "p50_ms": 138.6228,
  "p95_ms": 139.1754,
  "windows_per_s": 7.22,
  "bases_per_s": 1419831,
  "bins_per_s": 6471,
  "batch": 1,
  "seq_len": 196608,
  "dtype": "float32",
  "peak_npu_memory_gb": 3.8
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910