m
mengsihan/aparent
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/aparent on Ascend NPU

模型与任务

  • 模型:multimolecule/aparent
  • Revision:2d2848b4ca089699d174c23ef091428731413215
  • 适配路线:polyadenylation
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "huggingface_hub": "1.28.0",
  "multimolecule": "0.2.1",
  "npu_name": "Ascend910_9362",
  "cann": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_ref_sha256": "4f7047ecb2afa3e4",
  "sequence_alt_sha256": "9ef6883f8eb6c368",
  "sequence_length": 205,
  "alphabet": "A/C/G/T/U/N",
  "vocab_size": 5,
  "batch": 1,
  "replace_T_with_U": true,
  "tokenizer": "RnaTokenizer",
  "preview_ref": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATCTAGAGGGG...",
  "description": "205 nt polyadenylation window with canonical AATAAA PAS; alt has SNP at position 100"
}

真实推理结果

{
  "isoform_logits_shape": [
    1,
    1
  ],
  "cleavage_logits_shape": [
    1,
    206
  ],
  "isoform_ref_cpu": -1.525895,
  "isoform_ref_npu": -1.525679,
  "isoform_alt_cpu": -1.885323,
  "cleavage_softmax_sum": 1.0,
  "dtype": "float32",
  "device": "npu:0"
}

CPU-NPU 一致性

{
  "isoform_max_abs_diff": 0.0002161264,
  "isoform_mean_abs_diff": 0.0002161264,
  "cleavage_max_abs_diff": 0.0013244152,
  "cleavage_mean_abs_diff": 0.0004030927,
  "atol": 0.005,
  "rtol": 0.005,
  "passed": true
}

性能

{
  "first_inference_ms": 0.95,
  "stable_avg_ms": 0.89,
  "stable_min_ms": 0.85,
  "stable_max_ms": 0.91,
  "sequences_per_second": 1123.42,
  "bases_per_second": 230301.95,
  "batch": 1,
  "length": 205,
  "dtype": "float32",
  "peak_memory_mb": 41.2,
  "warmup_iters": 3,
  "stable_iters": 10
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910