liucu/multimolecule-aparent2-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/aparent2 on Ascend NPU

模型与任务

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

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "python": "3.11.14",
  "cann": "8.5.1",
  "model_dir": "/tmp/models/multimolecule-aparent2",
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "alphabet": "RNA A/C/G/U/N (T->U)",
  "strand": "5'->3'",
  "sequence_length": 205,
  "vocab_size": 5,
  "hexamer_position": 70,
  "hexamer_ref": "AAUAAA",
  "hexamer_alt": "AAUACA",
  "reference_sequence_sha256": "c04a456284ac1eb2967c195dd2993d489d2a377ab1a83e943fc491814ffd2e1c",
  "alternative_sequence_sha256": "3c757a9c44bcad6613545cf3b50b50c1b9c316e01dc12b96f2aa14802761de9b",
  "reference_sequence_preview": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAA...",
  "alternative_sequence_preview": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUACAAAAA...",
  "attention_mask": "all ones",
  "batch": 1,
  "dtype": "float32",
  "source": "synthetic 205-nt PAS window with core hexamer at 70 per APARENT2 paper; alternative variant deleterious example from model card"
}

真实推理结果

{
  "logits_shape": [
    1,
    206
  ],
  "logits_dtype": "float32",
  "logits_device": "npu:0",
  "cleavage_profile_ref_70_80": [
    3.081292152404785,
    1.651505470275879,
    4.391465187072754,
    10.960223197937012,
    6.170426368713379,
    4.496118545532227,
    4.230648517608643,
    4.934283256530762,
    4.638781547546387,
    4.485227584838867
  ],
  "prob_sum_ref": 0.9999998807907104,
  "isoform_usage_ref": 0.07777586579322815,
  "isoform_usage_alt": 0.015994712710380554,
  "delta_logodds": -1.6464157104492188,
  "peak_ref": 73,
  "peak_alt": 75,
  "no_cleavage_ref": 0.000269,
  "variant_effect_direction": "ref > alt (AAUAAA stronger)",
  "output_semantics": "cleavage logits 206 = 205 positions + no_cleavage bucket; isoform = sum prob 77:127; delta = log(alt/(1-alt)) - log(ref/(1-ref))"
}

CPU-NPU 一致性

{
  "compared": "softmax probability (cleavage distribution) 1x206 float32",
  "cpu": "cpu float32",
  "npu": "npu:0 float32",
  "atol": 0.001,
  "rtol": 1e-05,
  "max_abs_diff": 0.00014400482177734375,
  "mean_abs_diff": 2.144461859643343e-06,
  "logits_max_abs_diff": 0.006558418273925781,
  "logits_mean_abs_diff": 0.0026144396979361773,
  "pearson_r": 0.99999976,
  "peak_position_match": true,
  "variant_effect_direction_match": true,
  "threshold": "atol 0.001 on prob, 0.01 on logits passes",
  "output": "PASS"
}

性能

{
  "device": "npu:0",
  "dtype": "float32",
  "sequence_length": 205,
  "batch": 1,
  "warmup": 3,
  "stable_iters": 10,
  "avg_ms_per_iter": 6.53,
  "p50_ms": 6.54,
  "throughput_sequences_per_second": 153.1,
  "throughput_bases_per_second": 31385.7,
  "note": "timing with torch.npu.synchronize() before/after; first compile included in warmup; stable iters report"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • Variant effect scoring requires paired ref/alt 205-nt windows; library_index fixed to 11 per upstream.

标签

#NPU #Ascend #Ascend910