liucu/mmsplice
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/mmsplice on Ascend NPU

模型与任务

  • 模型:multimolecule/mmsplice
  • Revision:2f31775026d004540852623421fb738dc073b27f
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "device_name": "Ascend910_9362",
  "dtype": "float32",
  "model_dir": "/tmp/mmsplice_model_dir"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "reference_sequence_length": 220,
  "alternative_sequence_length": 220,
  "reference_exon": "CCCCCCCCCCCCCCCCCCCC",
  "alternative_exon": "CCCCCCCCCCUCCCCCCCCC",
  "variant": "exon pos 10 C->U",
  "reference_sha256": "5b92f8c61dc5fd4f45543f33374d9da08daab3d2cdd379ca8427a2e8fcec2dc8",
  "alternative_sha256": "9807b5949f9b280743d330d30476b1dd7fa1f7859b38e40528d072e780f9adad",
  "tokenizer": "RnaTokenizer A/C/G/U/N",
  "input_ids_shape": [
    1,
    220
  ],
  "context": "100nt upstream intron + 20nt exon + 100nt downstream intron = 220",
  "species": "human (generic)",
  "strand": "5'->3'"
}

真实推理结果

{
  "final_delta_logit_PSI": 1.010215401649475,
  "final_shape": [
    1,
    1
  ],
  "module_logits_ref": [
    -2.93148136138916,
    -8.648365020751953,
    -11.038805961608887,
    -0.9492347240447998,
    2.0419068336486816
  ],
  "module_logits_alt": [
    -2.93148136138916,
    -8.648365020751953,
    -10.386462211608887,
    -0.9492347240447998,
    2.0419068336486816
  ],
  "module_delta": [
    0.0,
    0.0,
    0.65234375,
    0.0,
    0.0
  ],
  "modules": [
    "acceptor_intron",
    "acceptor",
    "exon",
    "donor",
    "donor_intron"
  ],
  "output_device": "npu:0",
  "output_dtype": "float32"
}

CPU-NPU 一致性

{
  "cpu_npu_final_max_abs_diff": 9.739398956298828e-05,
  "cpu_npu_final_mean_abs_diff": 9.739398956298828e-05,
  "cpu_npu_module_ref_max_abs_diff": 0.0013246536254882812,
  "cpu_npu_module_ref_mean_abs_diff": 0.00041065216646529734,
  "cpu_npu_module_delta_max_abs_diff": 6.29425048828125e-05,
  "atol_final": 0.001,
  "rtol_final": 0.001,
  "atol_module": 0.005,
  "rtol_module": 0.005,
  "passed": true,
  "note": "Compare biologically relevant delta_logit_PSI and per-module scores; same weights, same sequences, same preprocessing"
}

性能

{
  "first_compile_latency_ms": 223.84,
  "stable_avg_latency_ms": 3.63,
  "warmup_iters": 3,
  "stable_iters": 10,
  "sequence_per_s": 275.6,
  "bases_per_s": 60625.3,
  "input_length": 220,
  "batch_size": 1,
  "dtype": "float32",
  "device": "npu:0"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约(100+20+100=220nt, 单变异C->U)、dtype float32 与 Ascend910 环境完成验证。

标签

#NPU #Ascend #Ascend910