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

multimolecule/xpresso on Ascend NPU

模型与任务

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

环境依赖

{
  "npu": "Ascend910 (2 chips, npu-smi 25.5.5)",
  "torch_npu_available": true,
  "python": "3.11.14",
  "framework": "torch + torch_npu, transformers 5.9.0, multimolecule",
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "contract": "10500bp human promoter DNA (A/C/G/T/N) centered on TSS, gene orientation 5'->3'; auxiliary features tensor shape (batch,6)",
  "source": "NCBI RefSeq GRCh38 eutils: NC_000017.11 / NC_000012.12 / NC_000011.10",
  "sequences": [
    {
      "gene": "TP53",
      "coord": "NC_000017.11:7682301-7692800(-)",
      "length_bp": 10500,
      "sha256": "969facaadf3f4ee2688f1f62414263aeff067f7c22288b187542fa5133f21026"
    },
    {
      "gene": "GAPDH",
      "coord": "NC_000012.12:9210526-9221025(+)",
      "length_bp": 10500,
      "sha256": "3bd4ec53ada36d3d43f26f2a04ca0e8ae7406e7c0efd1ef304a449ec439d5613"
    },
    {
      "gene": "HBB",
      "coord": "NC_000011.10:5221822-5232321(-)",
      "length_bp": 10500,
      "sha256": "203451f3bbb45375104cca648cb00ee007c9946f9a6b25e32f90e3b22e45dbe8"
    }
  ],
  "aux_features_fixture": "zeros(batch,6) documented neutral half-life fixture"
}

真实推理结果

{
  "shape": [
    3,
    1
  ],
  "semantics": "scalar mRNA expression prediction (log2 scale)",
  "predictions_log2_expression": {
    "TP53": 0.890642,
    "GAPDH": -1.511438,
    "HBB": -1.170318
  },
  "all_finite": true
}

CPU-NPU 一致性

{
  "passed": true,
  "shape": [
    3,
    1
  ],
  "elements": 3,
  "max_abs_diff": 5.221366882324219e-05,
  "mean_abs_diff": 3.5881996154785156e-05,
  "atol": 0.0001,
  "rtol": 0.001,
  "task_metrics_cpu_vs_npu": {
    "MAE": 3.5881996154785156e-05,
    "RMSE": 3.9624432247364894e-05,
    "Pearson_r": 0.9999999993815236,
    "Spearman_rho": 1.0,
    "note": "CPU vs NPU prediction agreement on 3 real GRCh38 promoter fixtures (no ground-truth labels; smoke consistency)"
  }
}

性能

{
  "warmup_runs": 3,
  "timed_runs": 10,
  "sync_before_after_each_iter": true,
  "batch": "3 sequences x 10500 bp",
  "inference_ms_mean_npu": 1.035,
  "inference_ms_mean_cpu": 32.804,
  "speedup_vs_cpu": 31.7,
  "sequences_per_s_npu": 2899.8,
  "bases_per_s_npu": 30448142,
  "peak_npu_memory_MB": 41.3,
  "dtype": "float32"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision a40f5d8、输入契约(10500bp 启动子 + 6 维零值半衰期特征 fixture)、float32 dtype 与 Ascend910 环境完成验证。
  • 未加载真实 mRNA 半衰期特征标签,辅助特征使用文档化的全零 fixture,预测值用于 CPU-NPU 一致性 smoke 验证而非完整任务精度评测。

标签

#NPU #Ascend #Ascend910