jsjs1258/borzoi-mouse-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/borzoi-mouse on Ascend NPU

模型与任务

  • 模型:multimolecule/borzoi-mouse
  • Revision:2a03d813289ccb49f98879c1c91f88888c94ca7a
  • 适配路线:long-context-tracks
  • 设备:npu:0 (Ascend910)

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "cann_python": "/usr/local/Ascend/cann-8.5.1",
  "npu_device_count": 2,
  "npu_device_name": "Ascend910_9362",
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_source": {
    "provider": "Ensembl REST (https://rest.ensembl.org)",
    "endpoint": "GET /sequence/region/mouse/11:69214041:69738328:1",
    "species": "Mus musculus",
    "assembly": "GRCm39",
    "region": "chr11:69214041-69738328",
    "feature": "524288 bp window centred on Trp53 (ENSMUSG00000059552)"
  },
  "sequence_sha256": "8be8e37214817db27371e054fce0be1928a2eab28f8ad7b6beda0a6264fc6674",
  "length_bp": 524288,
  "alphabet": [
    "A",
    "C",
    "G",
    "T"
  ],
  "input_shape": [
    1,
    524288
  ],
  "tokenizer": "DnaTokenizer",
  "window_contract": "fixed 524288 bp; 32 bp/bin; center crop to 6144 bins"
}

真实推理结果

{
  "output_shape": [
    1,
    6144,
    2608
  ],
  "output_semantics": "pre-softplus logits on bins x tracks grid (mouse track set)",
  "output_device": "npu:0",
  "postprocess": "model.postprocess -> softplus coverage (non-negative)",
  "top5_tracks_by_mean_central_coverage": [
    1860,
    1956,
    1833,
    1980,
    1418
  ],
  "central_bin_mean_coverage": 1.341133661414411,
  "central_bin_max_coverage": 149.92733764648438,
  "central_region_gcoords": "chr11:69279577-69345112"
}

CPU-NPU 一致性

{
  "baseline_backend": "cpu fp32",
  "target_backend": "npu:0 fp32",
  "atol": 0.05,
  "rtol": 0.02,
  "allclose": true,
  "max_abs_diff": 0.02639007568359375,
  "mean_abs_diff": 0.00023902791622835927,
  "finite_ratio_cpu": 1.0,
  "finite_ratio_npu": 1.0,
  "pearson_central_overall": 0.9999999958521658,
  "pearson_per_sample_track": {
    "track_0_central_bins": 0.9999999814200269,
    "track_652_central_bins": 0.9999999873873044,
    "track_1304_central_bins": 0.9999999941269566,
    "track_1956_central_bins": 0.9999999974317864,
    "track_2607_central_bins": 0.9999999936465114
  },
  "threshold_policy": "pre-declared: full-tensor allclose(0.05, 0.02) AND per-track Pearson r > 0.999 AND finite ratio == 1.0"
}

性能

{
  "input_length_bp": 524288,
  "batch_size": 1,
  "dtype": "float32",
  "warmup_iterations": 3,
  "stable_iterations": 10,
  "first_call_latency_s": 0.638,
  "stable_mean_latency_s": 0.2305,
  "stable_min_latency_s": 0.2298,
  "stable_max_latency_s": 0.231,
  "windows_per_s": 4.33892,
  "mbases_per_s": 2.275,
  "peak_npu_memory_gib": 3.65
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对 revision 2a03d813289ccb49f98879c1c91f88888c94ca7a 的权重、fp32 dtype 与单窗口 batch=1 契约完成验证。
  • 一致性为同输入 smoke consistency;未在 ENCODE/FANTOM5 标注数据上做完整任务评测。
  • 性能数据来自 Ascend910 单卡实测,随驱动与 CANN 版本可能变化。

标签

#NPU #Ascend #Ascend910