waylong/deepsea
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/deepsea on Ascend NPU

模型与任务

  • 模型:multimolecule/deepsea
  • Revision:7025225200b133f2c21f0e2ed26efe54bbcd3262
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1+gitee7ba04",
  "transformers": "5.9.0",
  "multimolecule": "0.2.1",
  "python": "3.11.14",
  "npu_name": "Ascend910_9362",
  "device_count": 2
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence": "ACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGC...",
  "sequence_length": 1000,
  "raw_length": 184,
  "sequence_sha256": "90f87296ff1ef3c1bc4d95203b75a08aac8e20621eda878c9c09c3fb1dedb61e",
  "species": "human",
  "alphabet": "ACGTN",
  "encoding": "DnaTokenizer 1-mer, one-hot internally",
  "padding": "none (fixed length)",
  "reverse_complement_average": true,
  "tokenizer": "DnaTokenizer from multimolecule/deepsea"
}

真实推理结果

{
  "logits_shape": [
    1,
    919
  ],
  "logits_dtype": "torch.float32",
  "logits_device": "npu:0",
  "num_labels": 919,
  "semantics": "919 chromatin features (DNase, TF binding, histone marks)",
  "sample_logits_0_5": [
    -3.1347849369049072,
    -4.123687267303467,
    -2.3114588260650635,
    -4.520112037658691,
    -2.566042184829712
  ],
  "sample_prob_0_5": [
    0.0416949987411499,
    0.01592695340514183,
    0.09017838537693024,
    0.01077053602784872,
    0.07135612517595291
  ],
  "logits_min_max_mean": [
    -11.506465911865234,
    0.26489558815956116,
    -5.63076639175415
  ]
}

CPU-NPU 一致性

{
  "cpu_device": "cpu",
  "npu_device": "npu:0",
  "atol": 0.001,
  "rtol": 0.001,
  "logits_max_abs_diff": 0.0010027885437011719,
  "logits_mean_abs_diff": 0.00032869481947273016,
  "prob_max_abs_diff": 6.48796558380127e-05,
  "prob_mean_abs_diff": 3.0979153962107375e-06,
  "pearson_corr_logits": 0.999999992882866,
  "finite_ratio_cpu": 1.0,
  "finite_ratio_npu": 1.0,
  "passed": true
}

性能

{
  "first_inference_ms": 4.097223281860352,
  "avg_ms": 4.274797439575195,
  "std_ms": 0.30455561297875505,
  "min_ms": 4.106044769287109,
  "max_ms": 5.043745040893555,
  "seq_per_s": 233.92921281888255,
  "bases_per_s": 233929.21281888254,
  "batch": 1,
  "sequence_length": 1000,
  "dtype": "float32",
  "peak_memory_MiB": 276.513671875,
  "warmup": 3,
  "stable_iters": 10
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910