gcw_6a3w2yXz/deepmel
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/deepmel on Ascend NPU

模型与任务

  • 模型:multimolecule/deepmel
  • Revision:71ce0c3a55680fff4e1e2bd81b171f82a575c78e
  • 适配路线:regulatory-sequence
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0+cpu",
  "torch_npu": "2.9.0.post1",
  "transformers": "4.57.6",
  "multimolecule": "0.2.1",
  "device_name": "Ascend910_9362",
  "device_count": 2,
  "npu_available": true
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "sequence_sha256": "3f9df6f3d8cc5557b4a23ea73665d39678689a22caf81707c251a2e75c5b6b71",
  "sequence_length": 500,
  "sequence_preview": "CGCGGGGGTGGCCGGGGCCAGGGCTTCCCACGTGCGCAGCAGGACGCAGCGCTGCCTGA...",
  "alphabet": "ACGT",
  "input_ids_shape": [
    1,
    500
  ],
  "batch_shape": [
    2,
    500
  ],
  "input_length": 500,
  "vocab_size": 5,
  "topics": 24,
  "description": "human TERT promoter 500bp window, deterministic, truncated from model card example"
}

真实推理结果

{
  "logits_shape": [
    1,
    24
  ],
  "probabilities_shape": [
    1,
    24
  ],
  "output_semantics": "[batch, 24_topics] multilabel probabilities via sigmoid(branch_avg) over forward+reverse complements",
  "logits_sample": [
    -0.53044,
    -3.30424,
    -2.35386,
    -5.48948,
    -3.73606
  ],
  "probabilities_sample": [
    0.37041,
    0.03542,
    0.08675,
    0.00411,
    0.02329
  ],
  "top5_topics": [
    [
      "topic_0",
      0.37041
    ],
    [
      "topic_18",
      0.1299
    ],
    [
      "topic_20",
      0.09726
    ],
    [
      "topic_2",
      0.08675
    ],
    [
      "topic_8",
      0.07428
    ]
  ],
  "dtype": "float32",
  "device": "npu:0"
}

CPU-NPU 一致性

{
  "logits_max_abs_diff": 0.00053,
  "logits_mean_abs_diff": 0.000205,
  "probs_max_abs_diff": 8.2e-05,
  "probs_mean_abs_diff": 9e-06,
  "atol": 0.005,
  "rtol": 0.005,
  "passed": true,
  "comparison": "CPU vs NPU same revision, same 500bp sequence, float32, decorator-averaged sigmoid"
}

性能

{
  "warmup_iterations": 3,
  "stable_iterations": 10,
  "avg_time_ms": 56.45,
  "sequence_per_second": 17.72,
  "bases_per_second": 8857.64,
  "batch2_seq_per_second": 34.39,
  "input_length": 500,
  "batch": 1,
  "dtype": "float32",
  "device": "npu:0",
  "peak_memory_allocated_MB": 13.16,
  "max_memory_allocated_MB": 29.59,
  "first_compile_ms": 715.94
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910