gcw_6a3w2yXz/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",
  "npu_available": true,
  "device_count": 2,
  "device_name": "Ascend910_9362",
  "model_dir": "/tmp/aparent_model",
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequences": [
    "ref_canonical_AAUAAA",
    "alt_variant_AAUACA",
    "real_UTR_1",
    "real_UTR_2"
  ],
  "sequence_length": 205,
  "batch": 4,
  "alphabet": "A/C/G/U/N",
  "hexamer_pos": 70,
  "sha256_prefix": {
    "ref_canonical_AAUAAA": "c04a456284ac1eb2",
    "alt_variant_AAUACA": "3c757a9c44bcad66",
    "real_UTR_1": "37188c76c04df878",
    "real_UTR_2": "89bb4bf79483b7af"
  }
}

真实推理结果

{
  "cleavage_shape": [
    4,
    206
  ],
  "isoform_shape": [
    4,
    1
  ],
  "logits_dtype": "torch.float32",
  "logits_device": "npu:0",
  "isoform_cpu": [
    -0.9766395092010498,
    -1.0389199256896973,
    -4.562890529632568,
    -7.43263578414917
  ],
  "isoform_npu": [
    -0.9765996336936951,
    -1.038965106010437,
    -4.562565326690674,
    -7.432460308074951
  ],
  "variant_delta_iso_cpu": 0.06228041648864746,
  "variant_delta_iso_npu": 0.06236547231674194
}

CPU-NPU 一致性

{
  "max_abs_cleavage": 0.0021963119506835938,
  "mean_abs_cleavage": 0.00027236840105615556,
  "max_abs_iso": 0.00032520294189453125,
  "max_abs_probs": 6.61015510559082e-05,
  "mean_abs_probs": 8.425294026892516e-07,
  "pearson_probs": 0.999999982870315,
  "passed": true
}

性能

{
  "first_latency_ms": 186.21308216825128,
  "avg_latency_ms": 0.8989492896944284,
  "min_ms": 0.8700769394636154,
  "max_ms": 0.9552193805575371,
  "p50_ms": 0.8938279934227467,
  "p95_ms": 0.9552193805575371,
  "sequences_per_s": 4449.6392019617515,
  "bases_per_s": 912176.036402159,
  "batch": 4,
  "seq_len": 205,
  "dtype": "float32"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910