gcw_6a3w2yXz/openspliceai-zebrafish.2000
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/openspliceai-zebrafish.2000 on Ascend NPU

模型与任务

  • 模型:multimolecule/openspliceai-zebrafish.2000
  • Revision:c46e23d93d13ed32f5d7a8ca9ac1cda795c38506
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "available",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "platform": "Linux-5.10.0-182.0.0.95.r2220_156.hce2.aarch64-aarch64-with-glibc2.35",
  "python": "3.11.14",
  "model_dir": "/tmp/openspliceai_zebrafish_model",
  "weight_bytes": 2969023
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_length": 5000,
  "context": 2000,
  "alphabet": "A/C/G/U/N",
  "replace_T_with_U": true,
  "tokenizer": "RnaTokenizer",
  "pad_token": "N",
  "pad_id": 4,
  "seq_sha256": "361cdc97b98ba296c2ed33d5b01c99c7a2713bb17771e9fc8a604cd8474dd93d",
  "seq_preview_first80": "AUGGCGAACCUUGGCUGCUGGAUGCUGGUUCUCUUUGUGGCCACAUGGAGUGACCUGGGCCUCUGCAUGCACAGCUCAGC",
  "seq_preview_last80": "CUCCUGCCCCUGCUGGCGCUGCUGGCCCUCUGGGGACCUGACCCAGCCGCAGCCUUUGUGAACCAACACCUGUGCGGCUC",
  "donor_positions": [
    1000,
    2500
  ],
  "acceptor_positions": [
    2000,
    4000
  ],
  "gc_content": 0.6302,
  "encoding": "no truncation, attention_mask sum = seq_length",
  "batch": 1,
  "example_input_ids_shape": [
    1,
    5000
  ],
  "example_input_ids_first20": [
    0,
    3,
    2,
    2,
    1,
    2,
    0,
    0,
    1,
    1,
    3,
    3,
    2,
    2,
    1,
    3,
    2,
    1,
    3,
    2
  ],
  "species": "zebrafish"
}

真实推理结果

{
  "logits_shape": [
    1,
    5000,
    3
  ],
  "logits_dtype": "torch.float32",
  "channels": [
    "no_splice",
    "acceptor",
    "donor"
  ],
  "logits_cpu_sample_0_3": [
    [
      6.970565319061279,
      -3.447152614593506,
      -5.056649208068848
    ],
    [
      7.132273197174072,
      -4.281463623046875,
      -4.049478054046631
    ],
    [
      7.284897804260254,
      -4.448411464691162,
      -3.3402528762817383
    ]
  ],
  "logits_npu_sample_0_3": [
    [
      6.970510482788086,
      -3.446878433227539,
      -5.056773662567139
    ],
    [
      7.1320600509643555,
      -4.281020164489746,
      -4.049776554107666
    ],
    [
      7.284700393676758,
      -4.44846773147583,
      -3.3401706218719482
    ]
  ],
  "logits_cpu_donor_region_998_1003": [
    [
      8.122371673583984,
      -4.120796203613281,
      -5.254724025726318
    ],
    [
      7.896687984466553,
      -5.6540727615356445,
      -3.5043890476226807
    ],
    [
      9.28392219543457,
      -4.746271133422852,
      -3.7223029136657715
    ],
    [
      7.913466453552246,
      -2.367147922515869,
      -5.640158176422119
    ],
    [
      9.126338005065918,
      -5.765580654144287,
      -4.06296443939209
    ]
  ],
  "logits_npu_donor_region_998_1003": [
    [
      8.121435165405273,
      -4.120014667510986,
      -5.254005432128906
    ],
    [
      7.8961310386657715,
      -5.653304100036621,
      -3.5043089389801025
    ],
    [
      9.28338623046875,
      -4.7466349601745605,
      -3.7216854095458984
    ],
    [
      7.912998676300049,
      -2.36647629737854,
      -5.640295028686523
    ],
    [
      9.12591552734375,
      -5.765105247497559,
      -4.062179088592529
    ]
  ],
  "probs_cpu_mean_per_channel": [
    0.999980092048645,
    6.570621735590976e-06,
    1.3422675692709163e-05
  ],
  "probs_npu_mean_per_channel": [
    0.9999799728393555,
    6.572922757186461e-06,
    1.3426200894173235e-05
  ],
  "top_acceptor_cpu_idx": [
    4856,
    4966,
    4972,
    4983,
    4989
  ],
  "top_donor_cpu_idx": [
    305,
    452,
    110,
    4996,
    4994
  ],
  "top_acceptor_npu_idx": [
    4856,
    4966,
    4972,
    4983,
    4989
  ],
  "top_donor_npu_idx": [
    305,
    452,
    110,
    4996,
    4994
  ],
  "description": "per-nucleotide 3-channel logits (no_splice/acceptor/donor) with softmax probabilities; biological output is per-position donor/acceptor ranking"
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.002745389938354492,
  "mean_abs_diff": 0.0005029324092902243,
  "max_abs_per_channel": {
    "no_splice": 0.0015897750854492188,
    "acceptor": 0.002745389938354492,
    "donor": 0.002406597137451172
  },
  "mean_abs_per_channel": {
    "no_splice": 0.0004345336928963661,
    "acceptor": 0.0005646632052958012,
    "donor": 0.0005096001550555229
  },
  "atol": 0.005,
  "rtol": 0.001,
  "passed": true,
  "masked_length": 5000,
  "probs_max_abs_diff": 1.7525628209114075e-05
}

性能

{
  "first_latency_s": 0.2163219451904297,
  "avg_latency_s": 0.0028049230575561525,
  "iters": 10,
  "warmup": 3,
  "seq_per_s": 356.5160182580091,
  "bases_per_s": 1782580.0912900455,
  "seq_len": 5000,
  "batch": 1,
  "dtype": "torch.float32",
  "synchronized": true
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910