liucu/multimolecule-mtsplice-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/mtsplice on Ascend NPU

模型与任务

  • 模型:multimolecule/mtsplice
  • Revision:a3826976df62ae133f72d72a8c13d9b18777841b
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "device_name": "Ascend910_9362",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "ref_sequence_sha256": "306f6c4c14315a2b0e4812fe1a298d494ce42e06f434e7bf1221d6d188a102cf",
  "alt_sequence_sha256": "7c9ff60dfe8ce4891e9310b300c238cdce62e41e7b26fe1fa5ec09524e2b4334",
  "ref_length": 800,
  "alt_length": 800,
  "ref_preview": "AGCAGUCAUUAUGGCGAAUCUGGCAAGUAAGCAGUCAUUAUGGCGAAUCUGGCAAGUAAGCAGUCAUUAUGGCGAAUCUG",
  "alt_preview": "AGCAGUCAUUAUGGCGAAUCUGGCAAGUAAGCAGUCAUUAUGGCGAAUCUGGCAAGUAAGCAGUCAUUAUGGCGAAUCUG",
  "variant_position": 400,
  "acceptor_length": 400,
  "donor_length": 400,
  "source": "synthetic 800bp derived from model card example AGCAGUCAUUAUGGCGAAUCUGGCAAGUA repeated"
}

真实推理结果

{
  "logits_shape": [
    1,
    56
  ],
  "delta_logits_shape": [
    1,
    56
  ],
  "logits_sample_cpu": [
    -0.11336351931095123,
    -0.005916563794016838,
    -0.04765350744128227,
    -0.0549088753759861,
    0.09758420288562775
  ],
  "delta_sample_cpu": [
    0.01850569248199463,
    -0.001321596559137106,
    -0.01453186571598053,
    -0.013159092515707016,
    -0.0017261728644371033
  ],
  "delta_sample_npu": [
    0.01850537210702896,
    -0.001321085263043642,
    -0.014529664069414139,
    -0.013155896216630936,
    -0.0017258226871490479
  ]
}

CPU-NPU 一致性

{
  "max_abs_diff_delta": 1.2531876564025879e-05,
  "mean_abs_diff_delta": 2.4634978867002895e-06,
  "max_abs_diff_logits": 0.0004582405090332031,
  "mean_abs_diff_logits": 4.1568227711000615e-05,
  "atol": 0.001,
  "rtol": 0.001,
  "passed": true,
  "pearson": 1.0
}

性能

{
  "avg_ms": 4.362648900132626,
  "single_ms": 4.443723999429494,
  "seq_per_s": 229.21853738209361,
  "bases_per_s": 183374.82990567488,
  "iterations": 10,
  "warmup": 3,
  "dtype": "float32",
  "batch_size": 1,
  "note": "timing after torch.npu.synchronize, includes NPU compute only"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、800bp 盒式外显子侧翼输入、float32 与 Ascend910 完成验证。

标签

#NPU #Ascend #Ascend910