gcw_6a3w2yXz/deltasplice-human-NPU-1572
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/deltasplice-human on Ascend NPU

模型与任务

  • 模型:multimolecule/deltasplice-human
  • Revision:main
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "cann": "8.5.1",
  "npu": "Ascend910_9362",
  "device_count": 2,
  "transformers": "4.57.6",
  "multimolecule": "0.3.x"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "ref_seq_len": 29,
  "ref_seq_sha256": "b7f89be8dec01e55",
  "alt_seq_len": 29,
  "alt_seq_sha256": "0df7e5524280f118",
  "alphabet": "A/C/G/U/N",
  "pad_token_id": 4,
  "tokenizer": "RnaTokenizer",
  "context": 30000,
  "long_test_len": 200,
  "batch_size": 1
}

真实推理结果

{
  "probabilities": {
    "shape": [
      1,
      29,
      3
    ],
    "channels": [
      "no_splice",
      "acceptor",
      "donor"
    ],
    "device": "npu:0",
    "dtype": "float32",
    "sample_0": [
      1.0,
      2.1395689e-09,
      4.0157224e-09
    ],
    "per_pos_sum_min": 1.0,
    "per_pos_sum_max": 1.0
  },
  "site_probabilities": {
    "shape": [
      1,
      29,
      3
    ],
    "device": "npu:0"
  },
  "delta": {
    "shape": [
      1,
      29,
      3
    ],
    "device": "npu:0",
    "sample_0": [
      0.0,
      -4.52e-10,
      3.29e-10
    ],
    "max_abs": 8.6e-05
  },
  "long_output": {
    "shape": [
      1,
      200,
      3
    ],
    "device": "npu:0"
  }
}

CPU-NPU 一致性

{
  "probabilities": {
    "passed": true,
    "shape": [
      1,
      29,
      3
    ],
    "elements": 87,
    "max_abs_diff": 1.226071617566049e-07,
    "mean_abs_diff": 4.915420699301039e-09,
    "atol": 0.0001,
    "rtol": 0.0001
  },
  "delta": {
    "passed": true,
    "shape": [
      1,
      29,
      3
    ],
    "elements": 87,
    "max_abs_diff": 9.536597644910216e-08,
    "mean_abs_diff": 2.5674254232727736e-09,
    "atol": 0.0001,
    "rtol": 0.0001
  },
  "site_probabilities": {
    "passed": true,
    "shape": [
      1,
      29,
      3
    ],
    "elements": 87,
    "max_abs_diff": 1.5419209375977516e-06,
    "mean_abs_diff": 8.860721856368484e-08,
    "atol": 0.0001,
    "rtol": 0.0001
  },
  "tolerance": {
    "atol": 0.0001,
    "rtol": 0.0001
  },
  "note": "CPU (float32) vs NPU (float32) on same 29-nt SNP pair, NPU shows max diff ~1e-07"
}

性能

{
  "warmup": 3,
  "stable": 10,
  "mean_ms": 47.0,
  "min_ms": 46.97,
  "max_ms": 47.05,
  "sequence_per_s": 21.27,
  "bases_per_s": 616.96,
  "delta_mean_ms": 93.8,
  "long_200nt_ms": 51.6,
  "dtype": "float32",
  "batch": 1,
  "length": 29,
  "device": "npu:0",
  "peak_hbm_mb": 3106
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910