jsjs1258/a2zchromatin-methylation-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/a2zchromatin-methylation on Ascend NPU

模型与任务

  • 模型:multimolecule/a2zchromatin-methylation
  • Revision:47ae930b83f8e5264bd4a3cb58c11bc7caa19857
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.7.1",
  "torch_npu": "2.7.1",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "device_name": "Ascend910_9362",
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequences": [
    {
      "name": "p53_184",
      "length": 184,
      "padded_length": 600,
      "sha256": "7a04b9f1828848818a7a04b9f182884881",
      "seq_preview": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGG..."
    },
    {
      "name": "ACGT_600",
      "length": 600,
      "sha256": "e4a387752a4865282071c8f2f26b4d990db42b00a357a5080766f61ba6f02dbd",
      "seq": "ACGT*150"
    },
    {
      "name": "BRCA1_88",
      "length": 99,
      "padded_length": 600,
      "sha256": "f60583147541647f...",
      "seq_preview": "TCATTGGAACAGAAAGAAATGG..."
    }
  ],
  "tokenizer": "DnaTokenizer",
  "vocab_size": 16,
  "padding": "max_length=600",
  "batch": 3,
  "input_ids_shape": [
    3,
    600
  ],
  "attention_mask_sums": [
    184,
    600,
    99
  ]
}

真实推理结果

{
  "logits_shape": [
    3,
    1
  ],
  "dtype": "float32",
  "device": "npu:0",
  "values": [
    -4.433578,
    0.009715,
    -5.915322
  ],
  "probs": [
    0.011733,
    0.502429,
    0.002691
  ],
  "biology": "regulatory-sequence methylation lack probability per 600bp window; binary head single logit"
}

CPU-NPU 一致性

{
  "cpu_vs_npu_max_abs_diff": 4.863739e-05,
  "cpu_vs_npu_mean_abs_diff": 3.666369e-05,
  "atol": 0.001,
  "rtol": 0.001,
  "passed": true,
  "logits_cpu": [
    -4.433601,
    0.009752,
    -5.915371
  ],
  "logits_npu": [
    -4.433578,
    0.009715,
    -5.915322
  ]
}

性能

{
  "device": "npu:0",
  "batch": 3,
  "sequence_length": 600,
  "dtype": "float32",
  "warmup": 3,
  "stable_iters": 10,
  "avg_ms_per_batch": 9.12,
  "seq_per_s": 109.69,
  "bases_per_s": 19746,
  "single_forward_ms": 5.96,
  "peak_memory_mb": "N/A",
  "synchronize": true
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910