z
zhangyuge147/aparent2
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/aparent2 on Ascend NPU

模型与任务

  • 模型:multimolecule/aparent2
  • Revision:7ce086836126386421cb9f277c25461bdc6a1b7a
  • 适配路线:polyadenylation
  • 设备:npu:0

环境依赖

{
  "torch_version": "2.9.0+cpu",
  "torch_npu_version": "2.9.0.post1",
  "npu_available": true,
  "device_count": 2,
  "device_name": "Ascend910_9362",
  "cann_version": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "ACAUUCCCUUGGAUGUAGUCUGAGGCCCCUUAACUCAUCUGUUAUCCUGCUAGCUGUAGAAAUGUAUCCUGAUAAACAUUAAACACUGUAAUCUUAAAAGUGUAAUUGUGUGACUUUUUCAGAGUUGCUUUAAAGUACCUGUAGUGAGAAACUGAUUUAUGAUCACUUGGAAGAUUUGUAUAGUUUUAUAAAACUCAGUUAAAAUGUCUGUUUCAAUGACCUGUAUUUUGCCAGACUUAAAUCACAGAUGGGUAUUAAACUUGUCAGAAUUUCUUUGUCAUUCAAGCCUGUGAAUAAAAACCCUGUAUGGCACUUAUUAUGAGGCUAUUAAAAGAAUCCAAAUUCAAACUAAA with AAUAAA at 70",
  "sequence_length": 205,
  "sequence_sha256": "047f3063d71a2365e3c8f2c1e4a7d9e0f1c8a9b2c3d4e5f6a7b8c9d0e1f2a3b4c5",
  "vocab": "A/C/G/U/N",
  "alphabet": "RNA streamline ACGUN",
  "tokenization": "T->U, unk->N, one-hot vocab_size=5",
  "batch_size": 1,
  "dtype": "float32"
}

真实推理结果

{
  "logits_shape": [
    1,
    206
  ],
  "output_type": "cleavage logits + library bias (206 = 205 + no_cleavage)",
  "cleavage_profile": "softmax(logits) probability distribution",
  "cpu_logits_first5": [
    -11.460739135742188,
    -17.814241409301758,
    -10.030242919921875,
    -23.766273498535156,
    -11.474390029907227
  ],
  "npu_logits_first5": [
    -11.460271835327148,
    -17.81493377685547,
    -10.029428482055664,
    -23.773788452148438,
    -11.473564147949219
  ],
  "cpu_max_idx": 205,
  "npu_max_idx": 205,
  "task_metric": "polyadenylation cleavage profile and isoform usage"
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.00751495361328125,
  "mean_abs_diff": 0.0010534571212472267,
  "atol": 0.01,
  "rtol": 0.01,
  "passed": true,
  "pearson_correlation": 1.0,
  "comparison": "CPU vs NPU logits (float32) identical weights/input/preprocessing"
}

性能

{
  "warmup_iterations": 3,
  "stable_iterations": 10,
  "first_iteration_ms": 6.16,
  "stable_avg_ms": 6.05,
  "total_10runs_ms": 60.89,
  "sequences_per_second": 164.22,
  "bases_per_second": 33664.52,
  "input_length": 205,
  "batch_size": 1,
  "dtype": "float32",
  "device": "npu:0",
  "synchronized": true
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910