m
mengsihan/multimolecule-ufold
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/ufold on Ascend NPU

模型与任务

  • 模型:multimolecule/ufold
  • Revision:538de5c2f48e56731c092e40d54c641ff84a2154
  • 适配路线:rna-secondary-structure
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "device_name": "Ascend910_9362",
  "canonical_model": "multimolecule/ufold",
  "revision": "538de5c2f48e56731c092e40d54c641ff84a2154"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "GGUCUCUCUGGUUAGACCAGAUCUGAGCCUGGGAGCUCUCUGGCUAACUAGGGAACC",
  "length": 57,
  "sha256": "d98dc16a5bdf653371f61d4bf9aac95685c05e55604e2a5ef0b1ca28ea174396",
  "source": "HIV-1 TAR-WT fixture (real RNA)",
  "tokenizer": "RnaTokenizer from local models/ufold"
}

真实推理结果

{
  "contact_map_shape": [
    57,
    57
  ],
  "dtype": "float32",
  "finite": true,
  "in_range_0_1": true,
  "predicted_pairs": 20,
  "reference_pairs": 20,
  "precision": 1.0,
  "sensitivity": 1.0,
  "f1": 1.0,
  "predicted_structure": "(((.(((((((((((.(((((....(..........).)))))))))))))))))))",
  "structural_constraints": {
    "length": 57,
    "symmetry_max_abs_err": 0.0,
    "diagonal_raw_max": 0.50152987241745,
    "min_loop_size": 10,
    "bases_with_multiple_pairs": 0,
    "constraints_ok": true
  }
}

CPU-NPU 一致性

{
  "atol": 0.001,
  "rtol": 0.001,
  "max_abs_diff": 0.00042057037353515625,
  "mean_abs_diff": 1.442363331479743e-06,
  "passed": true,
  "comparison": "CPU vs NPU cropped 57x57 contact map (sigmoid)"
}

性能

{
  "sequence_length": 495,
  "batch_size": 1,
  "dtype": "float32",
  "warmup_iters": 3,
  "stable_iters": 10,
  "mean_latency_s": 0.013656,
  "median_latency_s": 0.013456,
  "sequence_per_s": 73.2284,
  "bases_per_s": 36248.03,
  "peak_memory_mb": 302.49,
  "device": "npu:0",
  "device_name": "Ascend910_9362"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910