gcw_6a3w2yXz/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",
  "npu_available": true,
  "device_count": 2,
  "device_name": "Ascend910_9362",
  "model_dir": "/tmp/a2zchromatin-accessibility2",
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequences": [
    "p53_TP53_184pad600",
    "BRCA1_101pad600",
    "HBB_147pad600",
    "random_seed42_600"
  ],
  "sequence_length": 600,
  "batch": 4,
  "alphabet": "A/C/G/T/N/IUPAC+.",
  "sha256_prefix": {
    "p53_TP53_184pad600": "9e12ec27708df048",
    "BRCA1_101pad600": "14b246b4084f03c9",
    "HBB_147pad600": "40a86f24159e5e7f",
    "random_seed42_600": "c089da2d72cf4f7f"
  },
  "note": "padded to 600bp with N, fixed-length DanQ topology, manual BiLSTM NPU patch"
}

真实推理结果

{
  "logits_shape": [
    4,
    1
  ],
  "probs_shape": [
    4,
    1
  ],
  "logits_dtype": "torch.float32",
  "logits_device": "npu:0",
  "probs_device": "npu:0",
  "logits_finite": true,
  "logits_sample_cpu": [
    -3.8955838680267334,
    -10.762988090515137,
    -7.470696926116943,
    -4.128727912902832
  ],
  "logits_sample_npu": [
    -3.8956727981567383,
    -10.763040542602539,
    -7.470844745635986,
    -4.129150867462158
  ],
  "probs_sample_cpu": [
    0.019926367327570915,
    2.1168227249290794e-05,
    0.0005692070699296892,
    0.01584814302623272
  ],
  "probs_sample_npu": [
    0.019924629479646683,
    2.116711766575463e-05,
    0.0005691229598596692,
    0.015841547399759293
  ]
}

CPU-NPU 一致性

{
  "max_abs_logits": 0.0004229545593261719,
  "mean_abs_logits": 0.0001780390739440918,
  "pearson_logits": 0.9999999990774175,
  "max_abs_probs": 6.595626473426819e-06,
  "mean_abs_probs": 2.1046735128038563e-06,
  "pearson_probs": 0.9999999741074187,
  "passed": true
}

性能

{
  "first_latency_ms": 236.75331519916654,
  "avg_latency_ms": 16.46935986354947,
  "min_ms": 16.01769169792533,
  "max_ms": 16.742856241762638,
  "p50_ms": 16.574053093791008,
  "p95_ms": 16.742856241762638,
  "sequences_per_s": 242.87525642407823,
  "bases_per_s": 145725.15385444695,
  "batch": 4,
  "seq_len": 600,
  "dtype": "float32"
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。manual BiLSTM patch used to work around NPU LSTM kernel missing TBE.

标签

#NPU #Ascend #Ascend910