w
gcw_uQ09W7jl/borzoi-mouse
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/borzoi-mouse on Ascend NPU

模型与任务

  • 模型:multimolecule/borzoi-mouse
  • Revision:2a03d813289ccb49f98879c1c91f88888c94ca7a
  • 适配路线:long-context-tracks
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "4.57.6",
  "python": "3.11.14",
  "device_name": "Ascend910_9362",
  "npu_count": 2,
  "model_dir": "persist_models/multimolecule_borzoi-mouse"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGT...",
  "sequence_length": 524288,
  "sha256": "485bdeec7800c9614a28f304de8dd98c5a1d82257e68dc22d74f1ae2414abb05",
  "alphabet": "A/C/G/T/N",
  "direction": "5'->3'",
  "species": "mouse",
  "target_length": 6144,
  "num_tracks": 2608,
  "bin_size_bp": 32,
  "tokenizer": "DnaTokenizer",
  "vocab": [
    "A",
    "C",
    "G",
    "T",
    "N"
  ]
}

真实推理结果

{
  "logits_shape": [
    1,
    6144,
    2608
  ],
  "coverage_shape": [
    1,
    6144,
    2608
  ],
  "logits_dtype": "torch.float32",
  "coverage_dtype": "torch.float32",
  "logits_min": -12.241969108581543,
  "logits_max": 15.622989654541016,
  "logits_mean": -1.6917626857757568,
  "logits_sample_0_0": [
    -3.7548398971557617,
    -3.7845022678375244,
    -3.906949520111084,
    -4.08142614364624,
    -4.316953182220459
  ],
  "coverage_mean": 0.6613500118255615,
  "finite_ratio": 100.0
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.004868030548095703,
  "mean_abs_diff": 0.0003081869155475537,
  "atol": 0.02,
  "rtol": 0.001,
  "pearson_corr_subset": 0.9999999868633305,
  "passed": true,
  "finite_ok": true
}

性能

{
  "warmup_runs": 3,
  "stable_runs": 10,
  "avg_ms": 235.23,
  "min_ms": 230.21,
  "max_ms": 276.89,
  "p50_ms": 230.65,
  "windows_per_s": 4.25,
  "bases_per_s": 2228826,
  "input_length": 524288,
  "output_shape": [
    1,
    6144,
    2608
  ],
  "dtype": "float32",
  "device": "npu:0"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910