jsjs1258/xpresso-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/xpresso on Ascend NPU

模型与任务

  • 模型:multimolecule/xpresso
  • Revision:a40f5d8be7f28e93001677d11cb469bf96c66d52
  • 适配路线:expression
  • 设备:npu:0

环境依赖

{
  "python": "3.11.14",
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "npu_device_name": "Ascend910_9362",
  "cann_hint": "ascend_toolkit 8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "contract": "DnaTokenizer DNA promoter window, fixed input_length=10500 centered on TSS, aux features (batch,6)",
  "sequences": [
    {
      "gene": "HBB",
      "ensembl_id": "ENSG00000244734",
      "grch38_region": "11:5224146..5234645",
      "tss_grch38": 5229395,
      "strand": -1,
      "sha256": "39eccc930e80db9655d9506163a0d1646237cd4f81a2b92fc52ab7dd1924640a"
    },
    {
      "gene": "GAPDH",
      "ensembl_id": "ENSG00000111640",
      "grch38_region": "12:6528763..6539262",
      "tss_grch38": 6534012,
      "strand": 1,
      "sha256": "366cadfaabd0748484f958a8d3a52ef98af3ac0843a19325750266780d6293b3"
    },
    {
      "gene": "TP53",
      "ensembl_id": "ENSG00000141510",
      "grch38_region": "17:7682297..7692796",
      "tss_grch38": 7687546,
      "strand": -1,
      "sha256": "1bb388f0544252f3a9376f65672f751dd9764d4cf7de9c229e0b2c5215b4c56c"
    }
  ],
  "batch_shape": [
    3,
    10500
  ]
}

真实推理结果

{
  "shape": [
    3,
    1
  ],
  "cpu_log_expression": [
    -1.015068,
    -0.200648,
    -0.219531
  ],
  "npu_log_expression": [
    -1.015065,
    -0.200612,
    -0.219569
  ]
}

CPU-NPU 一致性

{
  "max_abs_diff": 3.784894943237305e-05,
  "mean_abs_diff": 2.5798877686611377e-05,
  "atol": 0.0001,
  "rtol": 0.001,
  "allclose": true,
  "pearson_r": 0.9999999968201753,
  "spearman_rho": 1.0,
  "finite_outputs": true,
  "independent_checker": "scripts/compare_outputs.py passed=true"
}

性能

{
  "warmup_iters": 3,
  "stable_iters": 10,
  "ms_per_iter": 1.1,
  "seq_per_s": 2727.8,
  "bases_per_s": 28642329,
  "peak_mem_mb": 41.5
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对 revision a40f5d8be7f28e93001677d11cb469bf96c66d52 与 Ascend910_9362 环境完成验证。
  • 上游 half-life 特征表未随 checkpoint 发布;辅助 features 使用由真实序列确定性推导的描述子,CPU/NPU 完全一致。
  • 单批 3 条真实启动子的 smoke consistency,非全量测试集精度评测。

标签

#NPU #Ascend #Ascend910