m
mengsihan/mmsplice
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/mmsplice on Ascend NPU

模型与任务

  • 模型:multimolecule/mmsplice
  • Revision:2f31775026d004540852623421fb738dc073b27f
  • 适配路线: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",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "numpy": "2.4.6",
  "cann": "8.5.1",
  "cann_version": "V100R001C25SPC002B220",
  "device_name": "Ascend910_9362",
  "device_count": 2
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "reference_sequence_length": 220,
  "alternative_sequence_length": 220,
  "reference_seq_exon": "CCCCCCCCCCCCCCCCCCCC",
  "alternative_seq_exon": "CCCCCCCCCCUCCCCCCCCC",
  "variant": "exon position 10 C->U",
  "overhang": [
    100,
    100
  ],
  "alphabet": "A/C/G/U/N",
  "replace_T_with_U": true,
  "reference_sha256": "5b92f8c61dc5fd4f45543f33374d9da08daab3d2cdd379ca8427a2e8fcec2dc8",
  "alternative_sha256": "9807b5949f9b280743d330d30476b1dd7fa1f7859b38e40528d072e780f9adad",
  "tokenizer": "RnaTokenizer",
  "input_ids_shape": [
    1,
    220
  ],
  "species": "human",
  "strand": "5'->3'",
  "input_ids_dtype": "int64"
}

真实推理结果

{
  "module_ref_logits_shape": [
    1,
    5
  ],
  "module_ref_logits": [
    -2.93148136138916,
    -8.648365020751953,
    -11.038805961608887,
    -0.9492347240447998,
    2.0419068336486816
  ],
  "module_alt_logits_shape": [
    1,
    5
  ],
  "module_alt_logits": [
    -2.93148136138916,
    -8.648365020751953,
    -10.386462211608887,
    -0.9492347240447998,
    2.0419068336486816
  ],
  "per_module_delta": [
    0.0,
    0.0,
    0.65234375,
    0.0,
    0.0
  ],
  "delta_logit_psi_shape": [
    1,
    1
  ],
  "delta_logit_psi": 1.010215401649475,
  "cpu_delta": 1.010312795639038,
  "dtype": "float32",
  "device": "npu:0",
  "finite": true
}

CPU-NPU 一致性

{
  "comparison": "CPU (float32) vs NPU (float32) same weights, same sequences, same preprocessing",
  "atol": 0.002,
  "rtol": 0.002,
  "delta_max_abs_diff": 9.739399e-05,
  "delta_mean_abs_diff": 9.739399e-05,
  "module_ref_max_abs_diff": 0.0013246536254882812,
  "module_ref_mean_abs_diff": 0.00041065216064453127,
  "passed": true,
  "note": "splicing delta and module scores within tolerance; task-specific metric is delta-logit-PSI direction consistent"
}

性能

{
  "warmup_iterations": 3,
  "stable_iterations": 10,
  "first_compile_ms": 3.226,
  "stable_avg_ms": 3.222,
  "stable_min_ms": 3.163,
  "stable_max_ms": 3.264,
  "sequence_per_second": 310.37,
  "bases_per_second": 68280.6,
  "input_length": 220,
  "batch_size": 1,
  "dtype": "float32",
  "peak_npu_memory_MiB": 32.25,
  "note": "timing with torch.npu.synchronize() before and after"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • Single variant example (C->U at exon pos10) smoke consistency, not full dataset evaluation

标签

#NPU #Ascend #Ascend910