w
gcw_uQ09W7jl/maxentscan-score5
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/maxentscan-score5 on Ascend NPU

模型与任务

  • 模型:multimolecule/maxentscan-score5
  • Revision:bca49854adf4c53362a82a6cfa58bea4de0d4e92
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu_available": true,
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "torch_npu": "2.9.0.post1+gitee7ba04"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "alphabet": "ACGUN (RNA, T->U)",
  "strand": "5'->3'",
  "window": 9,
  "mode": "score5",
  "add_special_tokens": false,
  "N_handling": "clamped to A (0) before base-4 hash",
  "compare_sequences": {
    "canonical_strong": {
      "sequence": "CAGGUAAGU",
      "sha256": "0089c903898caa6e",
      "length": 9
    },
    "perfect_consensus": {
      "sequence": "CAGGUAAGU",
      "sha256": "0089c903898caa6e",
      "length": 9
    },
    "weak_variant": {
      "sequence": "CAGGUACGU",
      "sha256": "017925fde7b8df98",
      "length": 9
    },
    "mutated_GT": {
      "sequence": "CAGGCAAGU",
      "sha256": "f385877fe04b7846",
      "length": 9
    },
    "polyU": {
      "sequence": "UUUUUUUUU",
      "sha256": "cf9f9da2b85bc62b",
      "length": 9
    },
    "alternative_strong": {
      "sequence": "AAGGUAAGU",
      "sha256": "848f9dfa15bb57a8",
      "length": 9
    },
    "suboptimal": {
      "sequence": "CAGGUAAAU",
      "sha256": "a475692fb84214b3",
      "length": 9
    },
    "G_donor": {
      "sequence": "GAGGUAAGU",
      "sha256": "0558f4a876aa9f3b",
      "length": 9
    }
  },
  "batch_size": 8,
  "compare_sequence_names": [
    "canonical_strong",
    "perfect_consensus",
    "weak_variant",
    "mutated_GT",
    "polyU",
    "alternative_strong",
    "suboptimal",
    "G_donor"
  ],
  "tokenizer": "RnaTokenizer (multimolecule)",
  "note": "Fixed 9-mer donor scorer; no padding needed. Batch stacked as [8,9] token ids."
}

真实推理结果

{
  "output_shape": [
    8,
    1
  ],
  "dtype": "float32",
  "window": 9,
  "mode": "score5",
  "scores": {
    "canonical_strong": 10.858312606811523,
    "perfect_consensus": 10.858312606811523,
    "weak_variant": 10.654662132263184,
    "mutated_GT": 3.104161262512207,
    "polyU": -31.079252243041992,
    "alternative_strong": 10.998353958129883,
    "suboptimal": 8.763776779174805,
    "G_donor": 11.07849407196045
  },
  "score_canonical": 10.858312606811523,
  "score_polyU": -31.079252243041992,
  "score_strong_vs_weak_delta": 41.937564849853516,
  "stats": {
    "min": -31.079252243041992,
    "max": 11.07849407196045,
    "mean": 4.404602527618408
  },
  "device_proof": "buffer:npu:0, logits:npu:0, input:npu:0, model_device_prop:npu:0",
  "compare_sequence": "CAGGUAAGU"
}

CPU-NPU 一致性

{
  "atol": 1e-05,
  "rtol": 1e-05,
  "max_abs_diff": 0.0,
  "mean_abs_diff": 0.0,
  "passed": true,
  "pearson": 1.0,
  "shape": [
    8,
    1
  ],
  "per_item_max_diff": 0.0
}

性能

{
  "first_run_ms": 148.80013465881348,
  "second_run_ms": 0.9355545043945312,
  "avg_ms": 0.6015300750732422,
  "min_ms": 0.5755424499511719,
  "max_ms": 0.6215572357177734,
  "p50_ms": 0.6026029586791992,
  "p90_ms": 0.6187677383422852,
  "throughput_windows_per_s": 13299.41815299247,
  "throughput_bases_per_s": 119694.76337693223,
  "batch_size": 8,
  "window": 9,
  "dtype": "float32"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910