waylong/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",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "npu_available": true,
  "python": "3.11.14",
  "cann": "8.5.1",
  "platform": "linux-aarch64"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGTCACAGCACATGACGGAGGTTGTGAGGCGCTGCCCCCACCATGAGCGCTGCTCAGATAGCGATGG",
  "sequence_length": 184,
  "sequence_sha256": "7a04b9f182884881",
  "padded_length": 600,
  "vocab": [
    "A",
    "C",
    "G",
    "T",
    "N",
    "R",
    "Y",
    "S",
    "W",
    "K",
    "M",
    "B",
    "D",
    "H",
    "V",
    "."
  ],
  "vocab_size": 16,
  "input_ids_shape": [
    1,
    600
  ],
  "attention_mask_sum": 184,
  "encoding": "DNA IUPAC, pad '.' id 15, attention_mask 1 for real 0 for pad",
  "source": "model card example: tumor protein p53",
  "species": "human (angiosperm model, sequence-only)",
  "dtype": "float32"
}

真实推理结果

{
  "logits_shape": [
    1,
    1
  ],
  "logits": -3.3736891746520996,
  "logits_cpu": -3.373632,
  "prob": 0.033128,
  "prob_cpu": 0.03313,
  "prediction": "inaccessible",
  "threshold": 0.5,
  "task": "chromatin accessibility binary classification",
  "output_axis": "single logit -> sigmoid",
  "finite": true
}

CPU-NPU 一致性

{
  "cpu_logits": -3.373632,
  "npu_logits": -3.3736891746520996,
  "max_abs_diff": 5.7220458984375e-05,
  "mean_abs_diff": 5.7220458984375e-05,
  "atol": 0.0001,
  "rtol": 0.001,
  "passed": true,
  "elements": 1,
  "shape": [
    1,
    1
  ]
}

性能

{
  "device": "npu:0",
  "dtype": "float32",
  "sequence_length": 600,
  "batch_size": 1,
  "warmup_iters": 3,
  "stable_iters": 10,
  "first_iter_seconds": 0.0723,
  "avg_seconds": 0.0086,
  "throughput_seq_per_s": 115.87,
  "throughput_bases_per_s": 69524.0,
  "peak_memory_mb": 3106,
  "synchronize": true
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910