waylong/maxentscan-score5
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/maxentscan-score5 on Ascend NPU

模型与任务

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

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "transformers": "4.57.6",
  "multimolecule": "0.2.1",
  "npu_available": true,
  "device_count": 2,
  "device_name": "Ascend910_9362",
  "cann": "8.5.1",
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequences": [
    "CAGGUAAGU",
    "AAGGUAAGU",
    "GAGGUAAGU",
    "CAGGUAAGA",
    "UUUUUUUUU",
    "CGGUAAUGU"
  ],
  "notes": [
    "high-score canonical donor chr1:1000:+ 3ex+GT+4in",
    "high-score variant chr1:2000:+",
    "high-score G at -3",
    "moderate - A at +6",
    "low-score poly-U negative control",
    "low-score non-consensus"
  ],
  "window": 9,
  "alphabet": "ACGU (T->U), N clamped to A",
  "vocab_size": 5,
  "input_ids_shape": [
    6,
    9
  ],
  "input_ids_dtype": "int64",
  "tokenizer": "direct A0 C1 G2 U3 N4 mapping (RnaTokenizer streamline equivalent)",
  "sha256_prefix": "9633eef4ba45ceae",
  "species": "human (MaxEntScan donor, hg38 reference)",
  "input_ids_sample": [
    1,
    0,
    2,
    2,
    3,
    0,
    0,
    2,
    3
  ]
}

真实推理结果

{
  "logits_shape": [
    6,
    1
  ],
  "logits_dtype": "float32",
  "scores": {
    "CAGGUAAGU": 10.858313,
    "AAGGUAAGU": 10.998354,
    "GAGGUAAGU": 11.078494,
    "CAGGUAAGA": 10.766342,
    "UUUUUUUUU": -31.079252,
    "CGGUAAUGU": -7.898431
  },
  "score_units": "log-odds (MaxEntScan 5' donor)",
  "output_type": "regression scalar per 9mer window",
  "consensus_positions": [
    3,
    4
  ],
  "rest_positions": [
    0,
    1,
    2,
    5,
    6,
    7,
    8
  ]
}

CPU-NPU 一致性

{
  "passed": true,
  "max_abs_diff": 4.76837158203125e-07,
  "mean_abs_diff": 7.947285970052083e-08,
  "atol": 0.0001,
  "rtol": 0.0001,
  "shape": [
    6,
    1
  ],
  "elements": 6,
  "cpu_device": "cpu",
  "npu_device": "npu:0",
  "dtype": "float32"
}

性能

{
  "per_iter_ms": 1.155,
  "single_ms": 1.151,
  "iters": 10,
  "warmup": 3,
  "batch": 6,
  "window": 9,
  "seq_per_s": 5196.23,
  "bases_per_s": 46766.07,
  "dtype": "float32",
  "device": "npu:0",
  "synchronized": true,
  "memory_allocated": 69120,
  "memory_reserved": 2097152
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • 仅验证 score5 (donor 9mer); score3 (acceptor 23mer) 未在本仓验证。
  • 未知碱基 N 按模型规范钳位到 A。

标签

#NPU #Ascend #Ascend910