liucu/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+gitee7ba04",
  "multimolecule": "0.2.1",
  "python": "3.11.14",
  "device": "Ascend910_9362",
  "platform": "Ascend NPU"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "window": 9,
  "mode": "score5",
  "vocab_size": 5,
  "alphabet": "ACGU N->A, T->U",
  "sequences": {
    "canonical_CAGGUAAGU": "CAGGUAAGU",
    "strong_GAGGUAAGU": "GAGGUAAGU",
    "moderate_AAGGUAGGU": "AAGGUAGGU",
    "weak_CAGGUAAAU": "CAGGUAAAU",
    "non_donor_UUUUUUUUU": "UUUUUUUUU",
    "cryptic_CUUACUUAC": "CUUACUUAC",
    "N_handling_NAGGUAAGU": "NAGGUAAGU",
    "snp_alt_CAGGUAGGU": "CAGGUAGGU",
    "brca1_donor_like": "GAGGUAAAA",
    "high_GG_GGGUAAGU": "GGGGUAAGU"
  },
  "primary_seq": "CAGGUAAGU",
  "primary_sha256": "0089c903898caa6e",
  "batch": 10,
  "dtype": "float32",
  "variant_pair": {
    "ref": "CAGGUAAGU",
    "alt": "CAGGCAAGU",
    "delta": -7.754151344299316
  },
  "species": "homo sapiens (GRCh38) donor window"
}

真实推理结果

{
  "primary_seq": "CAGGUAAGU",
  "primary_score": 10.858312606811523,
  "batch_shape": [
    10,
    1
  ],
  "batch_scores": [
    10.858312606811523,
    11.07849407196045,
    10.285365104675293,
    8.763776779174805,
    -31.079252243041992,
    -38.86586380004883,
    9.664477348327637,
    10.280213356018066,
    7.303686141967773,
    9.652448654174805
  ],
  "ranking_top": [
    {
      "name": "strong_GAGGUAAGU",
      "seq": "GAGGUAAGU",
      "score": 11.07849407196045
    },
    {
      "name": "canonical_CAGGUAAGU",
      "seq": "CAGGUAAGU",
      "score": 10.858312606811523
    },
    {
      "name": "moderate_AAGGUAGGU",
      "seq": "AAGGUAGGU",
      "score": 10.285365104675293
    }
  ],
  "variant_ref_score": 10.858312606811523,
  "variant_alt_score": 3.104161262512207,
  "variant_delta": -7.754151344299316,
  "device": "npu:0",
  "dtype": "torch.float32",
  "primary_sha256": "0089c903898caa6e",
  "window": 9
}

CPU-NPU 一致性

{
  "passed": true,
  "shape": [
    10,
    1
  ],
  "elements": 10,
  "max_abs_diff": 9.5367431640625e-07,
  "mean_abs_diff": 1.430511474609375e-07,
  "atol": 1e-05,
  "rtol": 1e-05,
  "pearson_r": 1.0,
  "dtype": "float32",
  "note": "CPU same revision, same tokenizer, same 10 donor 9-mers, N clamped handling, synchronized NPU"
}

性能

{
  "avg_ms_per_iter": 0.619,
  "p50_ms_per_iter": 0.62,
  "throughput_seq_per_s": 1614.54,
  "throughput_bases_per_s": 14530.8,
  "batch": 1,
  "window": 9,
  "dtype": "float32",
  "warmup": 3,
  "stable_iters": 10,
  "device": "npu:0",
  "peak_hbm_mb": 3169,
  "note": "torch.npu.synchronize before/after each iter, first compile excluded but not distinguished (table lookup minimal)"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • MaxEntScan score5 固定 9-nt 窗口,不支持可变长度或 inputs_embeds;N token 按官方 clamp 到 A 处理。
  • 单卡 npu:0 流水测量,未评估 score3 (23-nt) 窗口。

标签

#NPU #Ascend #Ascend910