liucu/openspliceai-mane.10000
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/openspliceai-mane.10000 on Ascend NPU

模型与任务

  • 模型:multimolecule/openspliceai-mane.10000
  • Revision:0f47ff0fd99a1016ad6d228dc6363c47989241c3
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "python": "3.11.14",
  "platform": "Linux-5.10.0-182.0.0.95.r2220_156.hce2.aarch64-aarch64-with-glibc2.35",
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "multimolecule": "0.2.1",
  "transformers": "5.9.0",
  "numpy": "1.26.4",
  "npu_available": true,
  "npu_device_count": 2,
  "device_name": "Ascend910_9362"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "source": "NCBI RefSeq NG_007485.1 (Homo sapiens CDKN2A RefSeqGene, LRG_11)",
  "window_coordinates": [
    23001,
    33000
  ],
  "sequence_sha256": "87f91b1b0ab691b9e8418d88077b3ae81ad614043f749bbbc8682355f6ad7355",
  "length_nt": 10000,
  "alphabet_counts": {
    "A": 2656,
    "C": 2273,
    "G": 2389,
    "T": 2682
  },
  "tokenizer": "RnaTokenizer (replace_T_with_U=True, pad=N)",
  "input_shape": [
    1,
    10000
  ],
  "input_dtype": "torch.int64",
  "annotated_ground_truth": {
    "exon2_donor_last_base": {
      "offset": 1813,
      "channel": 2,
      "motif": "GT at offsets 1814-1815"
    },
    "exon3_acceptor_first_base": {
      "offset": 5283,
      "channel": 1,
      "motif": "AG at offsets 5281-5282"
    }
  }
}

真实推理结果

{
  "logits_shape": [
    1,
    10000,
    3
  ],
  "dtype": "float32",
  "channels": {
    "0": "non_splice",
    "1": "acceptor",
    "2": "donor"
  },
  "labeling": "SpliceAI-style: acceptor marked on first exon base (preceded by intronic AG); donor marked on last exon base (followed by intronic GT)",
  "finite_ratio": 1.0,
  "predicted_sites_npu": {
    "acceptor": [
      {
        "offset": 5283,
        "prob_acceptor_donor": 0.976093,
        "motif_ok": true
      },
      {
        "offset": 8249,
        "prob_acceptor_donor": 0.992658,
        "motif_ok": true
      }
    ],
    "donor": [
      {
        "offset": 1813,
        "prob_acceptor_donor": 0.871959,
        "motif_ok": true
      },
      {
        "offset": 5589,
        "prob_acceptor_donor": 0.984136,
        "motif_ok": true
      }
    ]
  },
  "annotated_site_recall": {
    "exon2_donor_last_base": {
      "offset": 1813,
      "channel": "donor",
      "prob": 0.871959,
      "predicted": true
    },
    "exon3_acceptor_first_base": {
      "offset": 5283,
      "channel": "acceptor",
      "prob": 0.976093,
      "predicted": true
    }
  }
}

CPU-NPU 一致性

{
  "weights_and_inputs_identical": true,
  "logits_max_abs_diff": 0.00440216064453125,
  "logits_mean_abs_diff": 0.0005460010142996907,
  "logits_atol": 0.005,
  "logits_rtol": 0.01,
  "probs_max_abs_diff": 2.014636993408203e-05,
  "probs_mean_abs_diff": 9.111076337831037e-09,
  "probs_atol": 0.0001,
  "argmax_agreement_fraction": 1.0,
  "top_k_overlap": {
    "acceptor": 1.0,
    "donor": 1.0
  },
  "checks": [
    {
      "check": "fixture_sha256",
      "passed": true,
      "detail": "87f91b1b0ab691b9e8418d88077b3ae81ad614043f749bbbc8682355f6ad7355"
    },
    {
      "check": "fixture_length",
      "passed": true,
      "detail": "10000 nt (context=10000)"
    },
    {
      "check": "logits_allclose",
      "passed": true,
      "detail": "max_abs_diff=4.402e-03 mean_abs_diff=5.460e-04 atol=0.005 rtol=0.01"
    },
    {
      "check": "probs_max_abs_diff",
      "passed": true,
      "detail": "max_abs_diff=2.015e-05 mean_abs_diff=9.111e-09 atol=0.0001"
    },
    {
      "check": "argmax_agreement",
      "passed": true,
      "detail": "100.00% of 10000 positions"
    },
    {
      "check": "topk_ranking_overlap",
      "passed": true,
      "detail": "top-20 overlap acceptor=1.00 donor=1.00"
    },
    {
      "check": "acceptor_motif_consistency",
      "passed": true,
      "detail": "2/2 predicted acceptor sites carry the canonical AG motif"
    },
    {
      "check": "donor_motif_consistency",
      "passed": true,
      "detail": "2/2 predicted donor sites carry the canonical GT motif"
    },
    {
      "check": "annotated_exon2_donor_last_base",
      "passed": true,
      "detail": "offset=1813 channel=donor prob=0.8720 (GT at offsets 1814-1815)"
    },
    {
      "check": "annotated_exon3_acceptor_first_base",
      "passed": true,
      "detail": "offset=5283 channel=acceptor prob=0.9761 (AG at offsets 5281-5282)"
    }
  ],
  "note": "CPU float32 baseline vs NPU float32 on the same weights, tokens and order; thresholds fixed from measured float32 conv reassociation noise before release"
}

性能

{
  "warmup_runs": 3,
  "timed_runs": 10,
  "first_forward_compile_s": 0.3183,
  "stable_latency_ms_per_window": 161.77,
  "windows_per_s": 6.182,
  "bases_per_s": 61815.7,
  "batch_size": 1,
  "sequence_length": 10000,
  "dtype": "float32",
  "peak_npu_memory_mb": 34.98,
  "timing_sync": "torch.npu.synchronize() before and after every timed interval"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 验证针对固定 revision 与本仓库记录的真实 10000 nt CDKN2A (NG_007485.1:23001-33000) 窗口,属 smoke consistency 而非全基准评测。
  • 仅使用正向链推理;官方 OpenSpliceAI 的反向互补集成未包含在内。
  • 阈值基于本次实测的 float32 卷积结合顺序差异制定:logits atol=5e-3/rtol=1e-2,softmax 概率 atol=1e-4。

标签

#NPU #Ascend #Ascend910