m
mengsihan/xpresso
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": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "python": "3.11.14",
  "cann": "8.5.1",
  "device_name": "Ascend910_9362",
  "npu_count": 2
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_length": 99,
  "padded_length": 10500,
  "alphabet": "ACGTN",
  "direction": "5'->3'",
  "source": "multimolecule/xpresso widget BRCA1 DNA repair associated (padded to 10500)",
  "sha256": "f60583147541647f44153ef3ff53c06dc45585703484619fffdc9a6c4e2bf5fb",
  "tokenizer": "DnaTokenizer",
  "vocab_size": 5,
  "batch": 1,
  "example_sequence": "TCATTGGAACAGAAAGAAATGGATTTATCTGCTCTTCGCGTTGAAGAAGTACAAAATGTCATTAATGCTATGCAGAAAATCTTAGAGTGTCCCATCTGG",
  "num_features": 6,
  "features": [
    0.33669036626815796,
    0.12880940735340118,
    0.23446236550807953,
    0.23033303022384644,
    -1.1228563785552979,
    -0.18632829189300537
  ],
  "features_note": "synthetic deterministic half-life features seed 42"
}

真实推理结果

{
  "shape": [
    1,
    1
  ],
  "dtype": "float32",
  "axes": [
    "batch",
    "mRNA_abundance"
  ],
  "cpu_logits": [
    -0.1394929736852646
  ],
  "npu_logits": [
    -0.13949646055698395
  ],
  "biological_result": "predicted log median mRNA abundance CPU=-0.139493 NPU=-0.139496"
}

CPU-NPU 一致性

{
  "atol": 0.001,
  "rtol": 0.001,
  "max_abs_diff": 3.4868717193603516e-06,
  "mean_abs_diff": 3.4868717193603516e-06,
  "passed": true,
  "compared": "logits (1,1) scalar regression",
  "method": "np.allclose"
}

性能

{
  "first_compile_ms": 1.112,
  "stable_avg_ms": 0.987,
  "iters": 10,
  "warmup": 3,
  "batch": 1,
  "sequence_per_s": 1013.55,
  "bases_per_s": 10642313.46,
  "input_length": 10500,
  "dtype": "float32",
  "device": "npu:0",
  "synchronized": true
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • 单序列 smoke consistency,不代表全数据集精度评测。

标签

#NPU #Ascend #Ascend910