liucu/multimolecule-xpresso-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/xpresso on Ascend NPU

模型与任务

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

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "8.5.1",
  "transformers": "5.9.0",
  "multimolecule": "0.4.2",
  "numpy": "1.26.4",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "cann": "8.5.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "input_length": 10500,
  "num_features": 6,
  "num_labels": 1,
  "alphabet": "ACGTN",
  "strand": "5'->3'",
  "dtype": "float32",
  "primary_seq_name": "ACGT_repeat_10500",
  "primary_sha256": "e45ab83ce1fc39ac2a2ffb3a4ebb5fc388f638fc9b7f1668a5c914b4a002f7a6",
  "batch": 1,
  "route": "expression",
  "output": "scalar_expression"
}

真实推理结果

{
  "primary_seq_name": "ACGT_repeat_10500",
  "primary_sha256": "e45ab83ce1fc39ac2a2ffb3a4ebb5fc388f638fc9b7f1668a5c914b4a002f7a6",
  "primary_shape": [
    1,
    1
  ],
  "primary_dtype": "torch.float32",
  "primary_device": "npu:0",
  "primary_expression": -0.33656007051467896,
  "batch_shape": [
    3,
    1
  ],
  "batch_names": [
    "TP53_promoter_184bp",
    "HBB_promoter_142bp",
    "KRAS_promoter_122bp"
  ],
  "batch_expressions": [
    -0.20592088997364044,
    -0.1356770545244217,
    -0.19663585722446442
  ],
  "finite_proportion": 1.0,
  "route": "expression"
}

CPU-NPU 一致性

{
  "max_abs_diff": 7.092952728271484e-06,
  "mean_abs_diff": 4.410743713378906e-06,
  "atol": 0.0001,
  "rtol": 0.0001,
  "pearson": 1.0,
  "passed": true,
  "batch": 3,
  "comparison": "scalar_expression_logits"
}

性能

{
  "avg_ms": 1.043,
  "p50_ms": 1.043,
  "min_ms": 1.016,
  "max_ms": 1.077,
  "throughput_windows_per_s": 958.06,
  "throughput_bases_per_s": 10059616.3,
  "input_length": 10500,
  "batch": 1,
  "dtype": "float32",
  "device": "npu:0"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910