z
zhangyuge147/maxentscan-score3
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/maxentscan-score3 on Ascend NPU

模型与任务

  • 模型:multimolecule/maxentscan-score3
  • Revision:a6329dab709cf4e4a15c70124acbdafa48097d28
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "8.5.1",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "python": "3.11.14",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "cann": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "route": "splicing",
  "window": 23,
  "alphabet": "A/C/G/U/N",
  "strand": "5'->3'",
  "num_sequences": 8,
  "sequences": [
    "CAGGUUUUUCCCCAGGUAGGGAA",
    "AAAAAAAAAAAAAAAAAAAAAAA",
    "CCCCCCCCCCCCCCCCCCCCCCC",
    "UUUUUUUUUUUUUUUUUUUUUUU",
    "GGGGGGGGGGGGGGGGGGGGGGG",
    "ACGUAUGCAUGCAUGCAUGCAUG",
    "UUUUUCCCCAGGUAGGGAAAUUU",
    "CAGGUGAGUACGUACGUACGUAA"
  ],
  "sequence_sha256": "fa1c22520953d2b6a7c8e9f0",
  "tokenizer": "RnaTokenizer",
  "vocab": {
    "A": 0,
    "C": 1,
    "G": 2,
    "U": 3,
    "N": 4
  },
  "input_shape": [
    8,
    23
  ],
  "dtype": "int64"
}

真实推理结果

{
  "output_type": "logits (MaxEntScan score3 acceptor)",
  "shape": [
    8,
    1
  ],
  "dtype": "float32",
  "scores": [
    -10.2601,
    -16.2651,
    -5.7563,
    -5.7375,
    -27.0005,
    -12.1239,
    -19.7469,
    -18.3322
  ],
  "interpretation": "higher score = stronger 3' splice acceptor"
}

CPU-NPU 一致性

{
  "cpu_device": "cpu",
  "npu_device": "npu:0",
  "max_abs_diff": 1.9073486328125e-06,
  "mean_abs_diff": 4.76837158203125e-07,
  "atol": 1e-05,
  "rtol": 1e-05,
  "passed": true,
  "method": "torch.allclose on logits"
}

性能

{
  "device": "npu:0",
  "first_compile_latency_ms": 153.91,
  "stable_avg_latency_ms": 4.62,
  "stable_min_ms": 4.52,
  "stable_max_ms": 4.69,
  "batch": 8,
  "window": 23,
  "sequences_per_second": 1730.43,
  "bases_per_second": 39799.9,
  "dtype": "float32",
  "warmup_runs": 3,
  "stable_runs": 10,
  "synchronize": "torch.npu.synchronize() before and after"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910