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

multimolecule/maxentscan-score5 on Ascend NPU

模型与任务

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

环境依赖

{
  "hardware": "Ascend910_9362",
  "cann": "8.5.1",
  "python": "3.11",
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "multimolecule": "0.2.1",
  "transformers": "4.40",
  "hf_endpoint": "https://hf-mirror.com"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "window": 9,
  "n_windows": 48,
  "fixed_windows": 4,
  "transcripts": [
    "hsa-mir-21",
    "hsa-mir-146a",
    "hsa-mir-155"
  ],
  "alphabet": "ACGU",
  "add_special_tokens": false,
  "tokenizer": "RnaTokenizer",
  "example_records_sha256": "fixed_windows: CAGGUGAGU/CAGGUAAGU/CUAGUGAGU/GCAGUGAUG + 44 sliding 9-mers from 3 transcripts (total 48)",
  "sequence_source": "HBB donor windows + microRNA transcripts from model card widget"
}

真实推理结果

{
  "logits_shape": [
    48,
    1
  ],
  "logits_dtype": "torch.float32",
  "fixed_scores": {
    "HBB_IVS1_donor": 10.673586,
    "canonical_5ss_donor": 10.858313,
    "HBB_IVS2_donor": 7.434491,
    "decoy_GCAGUGAUG": -8.025276
  },
  "transcript_top3": {
    "hsa-mir-21": [
      [
        "GACUGAUGU",
        -8.3166
      ],
      [
        "UAGCUUAUC",
        -10.904
      ],
      [
        "CUGAUGUUG",
        -11.4706
      ]
    ],
    "hsa-mir-146a": [
      [
        "UCCAUGGGU",
        -6.1871
      ],
      [
        "GAACUGAAU",
        -8.5097
      ],
      [
        "AACUGAAUU",
        -11.0984
      ]
    ],
    "hsa-mir-155": [
      [
        "GUGAUAGGG",
        -3.9865
      ],
      [
        "AUGCUAAUC",
        -4.1286
      ],
      [
        "AUCGUGAUA",
        -6.9998
      ]
    ]
  },
  "splice_site_separation_ok": true,
  "n_buffers": 5,
  "input_ids_device": "npu:0",
  "logits_device": "npu:0"
}

CPU-NPU 一致性

{
  "cpu_vs_npu": {
    "atol": 0.0001,
    "rtol": 0.0001,
    "max_abs_diff": 3.814697265625e-06,
    "mean_abs_diff": 6.258487701416016e-07,
    "passed": true,
    "shape": [
      48,
      1
    ],
    "elements": 48
  },
  "separation_margin": 18.6989,
  "note": "same revision, same 48 windows, same preprocessing, float32"
}

性能

{
  "warmup": 3,
  "stable_iters": 10,
  "mean_sec_per_iter": 0.000567,
  "windows_per_sec": 84704.07,
  "n_windows": 48,
  "mean_ms_per_iter": 0.57,
  "device": "npu:0",
  "device_name": "Ascend910_9362",
  "sync": "torch.npu.synchronize() before/after timing"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910