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

multimolecule/openspliceai-mane.400 on Ascend NPU

模型与任务

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

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "python": "3.11.14",
  "cann": "8.5.1",
  "model_dir": "/opt/atomgit/.cache/huggingface/hub/models--multimolecule--openspliceai-mane.400/snapshots/eb24f956d1e6182eaa6e1110820cb30542f1ad66",
  "dtype": "float32",
  "revision": "eb24f956d1e6182eaa6e1110820cb30542f1ad66",
  "hf_endpoint": "https://hf-mirror.com"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "route": "splicing",
  "alphabet": "RNA A/C/G/U/N (vocab 5, pad N id4, replaces T->U true)",
  "strand": "5'->3'",
  "sequence_length": 500,
  "batch": 1,
  "primary_sequence_name": "synthetic_premRNA_500",
  "primary_sequence_sha256": "b1b713fd134d0e4984775b7a2fef2d602088a6eb505dfbcb9f781b7040ef644a",
  "primary_sequence_preview": "AUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGC",
  "all_sequences": {
    "insulin_mRNA_333": {
      "length": 333,
      "sha256": "f94af5b8cf66600fae963521f441dcb6c933e2d93165ba93bcafa3941ca946fc",
      "preview": "AUGGCCCUGUGGAUGCGCCUCCUGCCCCUGCUGGCGCUGCUGGCCCUCUGGGGACCUGACCCAGCCGCAGCCUUUGUGAA...",
      "source": "human INS mRNA from model card widget (MANE)"
    },
    "synthetic_premRNA_500": {
      "length": 500,
      "sha256": "b1b713fd134d0e4984775b7a2fef2d602088a6eb505dfbcb9f781b7040ef644a",
      "preview": "AUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGCAUGC...",
      "description": "synthetic intron(200)-exon(50)-intron(250) with GT donor and AG acceptor motifs, strand 5->3"
    },
    "context400_400": {
      "length": 400,
      "sha256": "3c7b1c74c6a9ffaa1ff96e09172f6aad5f4ba0785c54879d94e31ebc96f3ca65",
      "preview": "CAGGUUGAUAAGCUUGCAGGUUGAUAAGCUUGCAGGUUGAUAAGCUUGCAGGUUGAUAAGCUUG...",
      "description": "400 nt exact-context synthetic, A/C/G/U only"
    }
  },
  "tokenizer": "RnaTokenizer 1-mer, vocab A(0) C(1) G(2) U(3) N(4), pad=N id4, replace_T_with_U true",
  "model_dir": "/opt/atomgit/.cache/huggingface/hub/models--multimolecule--openspliceai-mane.400/snapshots/eb24f956d1e6182eaa6e1110820cb30542f1ad66",
  "revision": "eb24f956d1e6182eaa6e1110820cb30542f1ad66",
  "species": "human MANE",
  "context": 400,
  "task": "per-nucleotide splice-site prediction (neither/acceptor/donor)",
  "output_contract": "logits shape [batch, seq_len, 3] (neither, acceptor, donor)",
  "source": "model card widget + synthetic pre-mRNA with biologically canonical GT/AG"
}

真实推理结果

{
  "logits_shape": [
    1,
    500,
    3
  ],
  "logits_dtype": "float32",
  "logits_device": "npu:0",
  "logits_sample_cpu": [
    [
      1.387094497680664,
      -21.326141357421875,
      -19.162353515625
    ],
    [
      1.3323854207992554,
      -22.01171112060547,
      -16.998197555541992
    ]
  ],
  "logits_sample_npu": [
    [
      1.3873438835144043,
      -21.32134437561035,
      -19.158336639404297
    ],
    [
      1.3328553438186646,
      -22.009231567382812,
      -16.995878219604492
    ]
  ],
  "probabilities_top": {
    "acceptor_top3_indices": [
      208,
      216,
      206
    ],
    "acceptor_top3_probs": [
      0.0005463139968924224,
      0.00033602025359869003,
      0.00032078503863886
    ],
    "donor_top3_indices": [
      249,
      253,
      248
    ],
    "donor_top3_probs": [
      0.05135248973965645,
      0.003283224068582058,
      4.212490966892801e-05
    ]
  },
  "ranking_consistency": "top donor/acceptor rank CPU vs NPU match True (top1 identical)",
  "classes": [
    "neither",
    "acceptor",
    "donor"
  ],
  "problem_type": "multiclass per-token",
  "description": "dilated residual CNN predicts splice donor/acceptor at each nucleotide; output is 3-class logits per position"
}

CPU-NPU 一致性

{
  "passed": true,
  "max_abs_diff": 0.004797935485839844,
  "mean_abs_diff": 0.0010326128602027892,
  "atol": 0.01,
  "rtol": 0.01,
  "shape": [
    1,
    500,
    3
  ],
  "elements": 1500,
  "per_class_max": {
    "neither": 0.0015510916709899902,
    "acceptor": 0.004797935485839844,
    "donor": 0.004677057266235352
  },
  "note": "CPU same weights/seq/preprocess, softmax ranking identical, allclose passed at 1e-2"
}

性能

{
  "first_compile_ms": 211.49,
  "avg_time_ms": 1.98,
  "min_ms": 1.92,
  "max_ms": 2.05,
  "warmup": 3,
  "stable_iters": 10,
  "seq_per_s": 503.97,
  "bases_per_s": 251986.2,
  "batch": 1,
  "seq_len": 500,
  "dtype": "float32",
  "device": "npu:0",
  "note": "synchronized with torch.npu.synchronize(), excludes CPU tokenization"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 910环境完成验证。
  • splicing 输出为 per-nucleotide logits,排名一致性已验证,单序列 smoke consistency 非全数据集精度评测。

标签

#NPU #Ascend #Ascend910