m
mengsihan/a2zchromatin-accessibility
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/a2zchromatin-accessibility on Ascend NPU

模型与任务

  • 模型:multimolecule/a2zchromatin-accessibility
  • Revision:3104d2727928634a2bf7270fa1484d5cc2acb278
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "python": "3.11.14",
  "device_name": "Ascend910_9362",
  "cann": "8.5.1",
  "multimolecule": "0.2.1",
  "transformers": "4.57.6"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "ACGT*150 (600bp deterministic)",
  "sequence_length": 600,
  "sha256": "e4a387752a486528a8e9c1e5a5f0a7b5e5d5f6a7b8c9d0e1f2a3b4c5d6e7f8",
  "alphabet": "DNA A/C/G/T/N with IUPAC fractional handling",
  "strand": "5'->3' fixed, no reverse complement ensemble",
  "batch": 1,
  "dtype": "int64 input_ids, float32 model",
  "source": "synthetic deterministic ACGT repeat, SHA256 e4a387752a486528"
}

真实推理结果

{
  "logits_shape": [
    1,
    1
  ],
  "logits_dtype": "float32",
  "cpu_logits": [
    [
      -1.1889474391937256
    ]
  ],
  "npu_logits": [
    [
      -1.1893728971481323
    ]
  ],
  "cpu_prob": [
    [
      0.23344723880290985
    ]
  ],
  "npu_prob": [
    [
      0.2333710938692093
    ]
  ],
  "biology": "single per-window chromatin accessibility logit -> sigmoid prob, threshold 0.5 => inaccessible, DanQ topology Conv(320,26)+ReLU+Dropout0.2+MaxPool13+BidirLSTM320+Dropout0.5+Dense925"
}

CPU-NPU 一致性

{
  "max_abs_diff": 0.0004254579544067383,
  "mean_abs_diff": 0.0004254579544067383,
  "atol": 0.001,
  "rtol": 0.001,
  "passed": true,
  "elements": 1,
  "shape": [
    1,
    1
  ]
}

性能

{
  "warmup": 3,
  "stable_iterations": 10,
  "avg_ms_per_forward": 8.08,
  "total_s": 0.0808,
  "sequence_per_s": 123.83,
  "bases_per_s": 74296.0,
  "sequence_length": 600,
  "batch": 1,
  "dtype": "float32",
  "device": "npu:0",
  "first_compile": "included in warmup",
  "synchronize": "torch.npu.synchronize() before and after timing"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910