waylong/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",
  "transformers": "4.57.6",
  "multimolecule": "0.2.1",
  "python": "3.11.14",
  "cann": "8.5.1",
  "npu_name": "Ascend910_9362",
  "npu_available": true,
  "device_count": 2
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "reference_sequence_sha256": "5b92f8c61dc5fd4f8a2c7f3e1b9d0c4a5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2",
  "reference_length": 220,
  "reference_preview": "AAAAAAAAAAAAAAAAAAAA...GGGGGGGGGGGGGGGGGGGG",
  "alternative_sequence_sha256": "9807b5949f9b2807a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5",
  "alternative_length": 220,
  "variant": "exon position 10 (0-based) C>U, single SNV within 20 nt exon",
  "flanks": "100 nt upstream intron (A) + 100 nt downstream intron (G)",
  "alphabet": "RNA A/C/G/U, pad N",
  "tokenization": "RnaTokenizer add_special_tokens=False, replace_T_with_U=True, input_ids shape [1,220]",
  "sequence_source": "synthetic traceable RNA, avoids restricted data, matches official 220 nt example"
}

真实推理结果

{
  "per_module_reference_CPU": [
    -2.93152117729187,
    -8.647040367126465,
    -11.038663864135742,
    -0.9492347240447998,
    2.0424535274505615
  ],
  "per_module_reference_NPU": [
    -2.93148136138916,
    -8.648365020751953,
    -11.038805961608887,
    -0.9492347240447998,
    2.0419068336486816
  ],
  "variant_effect_CPU_delta_logit_PSI": [
    1.010312795639038
  ],
  "variant_effect_NPU_delta_logit_PSI": [
    1.010215401649475
  ],
  "delta_modules_CPU": [
    0.0,
    0.0,
    0.6524066925048828,
    0.0,
    0.0
  ],
  "delta_modules_NPU": [
    0.0,
    0.0,
    0.65234375,
    0.0,
    0.0
  ],
  "output_shape_modules": [
    1,
    5
  ],
  "output_shape_variant": [
    1,
    1
  ],
  "dtype": "float32",
  "device_proof": "first param npu:0, input_ids npu:0, output npu:0, torch.npu.synchronize used"
}

CPU-NPU 一致性

{
  "per_module_max_abs_diff": 0.0013246536254882812,
  "per_module_mean_abs_diff": 0.00041065216064453127,
  "per_module_atol": 0.005,
  "per_module_rtol": 0.001,
  "per_module_passed": true,
  "variant_max_abs_diff": 9.739398956298828e-05,
  "variant_mean_abs_diff": 9.739398956298828e-05,
  "variant_atol": 0.001,
  "variant_rtol": 0.001,
  "variant_passed": true,
  "overall": "PASS"
}

性能

{
  "first_forward_ms": 110.81,
  "stable_avg_ms": 5.74,
  "stable_min_ms": 4.66,
  "stable_max_ms": 15.21,
  "stable_median_ms": 4.69,
  "windows_per_s": 174.3,
  "bases_per_s": 38346.0,
  "input_length": 220,
  "batch": 1,
  "dtype": "float32",
  "device": "npu:0",
  "warmup": 3,
  "stable_iterations": 10,
  "synchronized": true
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910