m
mengsihan/deepcpgdna-smallwood2014-serum
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/deepcpgdna-smallwood2014-serum on Ascend NPU

模型与任务

  • 模型:multimolecule/deepcpgdna-smallwood2014-serum
  • Revision:b4f028333f9cf613e8b502bf68f7f0246c0a2438
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "npu_device": "Ascend910_9362",
  "npu_device_count": 2,
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "windows": 12,
  "sequence_length": 1001,
  "alphabet": "ACGTN",
  "genome": "mm10",
  "source_region": "mm10 chr1:3670001-3674000",
  "fixture_sha256": [
    "a585a8988bd6d3ca",
    "e0c367d6efbaadff",
    "56ebf079bbdef472",
    "80df789fe58794fd",
    "c8597ee1d471d729",
    "df5534cc25ee55ef",
    "776cf81aa91e3b48",
    "fcb450e5377068c5",
    "1d0b4826ff5eacca",
    "120752fb46138568",
    "ce0ba3c0976fb4ee",
    "629ada3bdf2d28a7"
  ]
}

真实推理结果

{
  "logits_shape": [
    12,
    18
  ],
  "probs_shape": [
    12,
    18
  ],
  "cells": [
    "BS27_1_SER",
    "BS27_3_SER",
    "BS27_5_SER",
    "BS27_6_SER",
    "BS27_8_SER",
    "BS28_10_SER",
    "BS28_1_SER",
    "BS28_2_SER",
    "BS28_3_SER",
    "BS28_4_SER",
    "BS28_6_SER",
    "BS29_1_SER",
    "BS29_4_SER",
    "BS29_5_SER",
    "BS29_6_SER",
    "BS29_7_SER",
    "BS29_8_SER",
    "BS29_9_SER"
  ],
  "mean_methylation_probability": 0.08883456885814667,
  "per_window_mean_probability": [
    0.226638,
    0.097129,
    0.103644,
    0.068325,
    0.09781,
    0.129859,
    0.111088,
    0.057741,
    0.046957,
    0.048039,
    0.035664,
    0.04312
  ]
}

CPU-NPU 一致性

{
  "logits": {
    "name": "logits",
    "shape": [
      12,
      18
    ],
    "max_abs_diff": 0.00020956993103027344,
    "mean_abs_diff": 9.821327748122039e-05,
    "rmse": 0.00010709139470795945,
    "pearson": 0.9999999980599898,
    "spearman": 0.999998809226116
  },
  "probs": {
    "name": "probs",
    "shape": [
      12,
      18
    ],
    "max_abs_diff": 2.206861972808838e-05,
    "mean_abs_diff": 7.197898985059173e-06,
    "rmse": 8.47886861477005e-06,
    "pearson": 0.9999999975110013,
    "spearman": 0.999998809226116
  },
  "logits_allclose": true,
  "probs_allclose": true,
  "correlation_ok": true
}

性能

{
  "preprocess_s": 0.08067,
  "first_npu_inference_s": 0.210277,
  "cpu_baseline_s": 0.043147,
  "stable_batch_s": 0.000987,
  "windows_per_s": 12153.587,
  "bases_per_s": 12165740.1,
  "warmup": 3,
  "stable_iterations": 10
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 单序列/小窗口集合上的 smoke 一致性验证,不宣称完整精度评测。
  • CPU-NPU 使用相同权重、相同 12 条真实 mm10 CpG 窗口、相同预处理与 float32 dtype。
  • 甲基化生物学数值为模型在血清 mESC(Smallwood 2014)18 个单细胞上的预测概率,未在此处做外部数据集评测。

标签

#NPU #Ascend #Ascend910