m
mengsihan/spotrna
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/spotrna on Ascend NPU

模型与任务

  • 模型:multimolecule/spotrna
  • Revision:main
  • 适配路线:rna-secondary-structure
  • 设备:npu:0

环境依赖

{
  "torch_version": "2.9.0+cpu",
  "torch_npu_version": "2.9.0.post1+gitee7ba04",
  "device_name": "Ascend910_9362",
  "python_version": "3.11.14",
  "transformers_version": "5.9.0",
  "multimolecule_version": "0.2.1"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "GGGCUAUUAGCUCAGUUGGUUAGAGCGCACCCCUGAUAAGGGUGAGGUCGCUGAUUCGAAUUCAGCAUAGCUCA",
  "short_sequence": "UAGCUUAUCAGACUGAUGUUGA",
  "length": 74,
  "short_length": 22,
  "sha256": "f5014cfb7b1ff718df070139c8fe937414f7a8de7396b7e2a0faed0f405b3d6f",
  "input_ids_shape": [
    1,
    74
  ],
  "attention_mask_shape": [
    1,
    74
  ]
}

真实推理结果

{
  "contact_map_shape": [
    1,
    74,
    74
  ],
  "logits_shape": [
    1,
    74,
    74
  ],
  "contact_map_dtype": "torch.float32",
  "contact_map_sample": [
    0.0,
    0.0,
    2.153049960540443e-09,
    2.603322002414643e-09,
    2.2535867572059942e-07
  ],
  "threshold": 0.335
}

CPU-NPU 一致性

{
  "max_abs_diff_contact": 6.619095802307129e-05,
  "mean_abs_diff_contact": 1.1856276344076782e-07,
  "max_abs_diff_logits": 0.008617401123046875,
  "mean_abs_diff_logits": 0.0010228059857040417,
  "atol": 0.0001,
  "rtol": 0.0001,
  "passed": true
}

性能

{
  "avg_time_s": 0.08504366874694824,
  "min_time_s": 0.0844118595123291,
  "max_time_s": 0.08550333976745605,
  "sequence_per_s": 11.758664868698819,
  "bases_per_s": 870.1412002837126,
  "warmup": 3,
  "stable_iters": 10,
  "length": 74,
  "dtype": "float32",
  "device": "npu:0",
  "first_compile_s": 0.08518838882446289
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910