jsjs1258/mtsplice
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

multimolecule/mtsplice on Ascend NPU

模型与任务

  • 模型:multimolecule/mtsplice
  • Revision:a3826976df62ae133f72d72a8c13d9b18777841b
  • 适配路线:splicing
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0",
  "torch_npu": "2.9.0.post1",
  "cann": "8.5.1",
  "npu_name": "Ascend910_9362",
  "device_count": 2,
  "python": "3.11.14"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "alphabet": "RNA A/C/G/U/N (replace_T_with_U=True)",
  "direction": "5'->3'",
  "species": "Homo_sapiens",
  "acceptor_length": 400,
  "donor_length": 400,
  "total_length": 800,
  "vocab_size": 4,
  "tokenizer": "RnaTokenizer",
  "fixtures": 3,
  "example_ref_seq_prefix": "AUGCUAGCUAGCUAGCUAGCUAGCUAGCUAGCUAGCUAGC",
  "example_ref_sha256": "d2074e24d5055a55a7fa3f6762933ded099a98c66745e833a9f37436fa85888c",
  "example_alt_sha256": "be7aab903d40276fbc98f19ca3056b7c610721048b2eac47bd11269d335cbc9f",
  "variant_position": 400,
  "variant_ref": "G",
  "variant_alt": "C",
  "attention_mask": "all 800 valid (no padding)"
}

真实推理结果

{
  "task": "tissue-specific splicing variant effect (delta-logit-PSI)",
  "output_name": "logits",
  "output_shape": "[3, 56]",
  "num_tissues": 56,
  "example_outputs": {
    "REF_top5": {
      "51": 3.0393,
      "12": 1.4317,
      "0": 1.4017,
      "13": 1.3908,
      "40": 1.0967
    },
    "ALT_top5": {
      "51": 3.0283,
      "12": 1.4291,
      "0": 1.3991,
      "13": 1.3884,
      "40": 1.0944
    },
    "delta_max": -0.011019,
    "delta_most_affected_idx": 51,
    "delta_most_affected_tissue": "Brain_Cortex_dup2"
  },
  "alternative_logits_shape": "[1, 56]",
  "delta_logits_shape": "[1, 56]",
  "delta_consistency_max_diff": 0.0
}

CPU-NPU 一致性

{
  "comparison": "CPU logits vs NPU logits (same weights, same sequences, float32)",
  "max_abs_diff": 0.00031638145446777344,
  "mean_abs_diff": 0.00012372283908050684,
  "threshold": 0.0005,
  "metric": "abs_diff",
  "dtype": "float32",
  "elements": 168,
  "shape": [
    3,
    56
  ],
  "atol": 0.0005,
  "rtol": 0.0005,
  "passed": true,
  "delta_max_abs_diff": 1.1444091796875e-05,
  "delta_passed": true
}

性能

{
  "warmup": 3,
  "iters": 10,
  "batch_size": 3,
  "sequence_length": 800,
  "total_bases_per_batch": 2400,
  "avg_ms": 5.819,
  "min_ms": 5.238,
  "max_ms": 6.756,
  "seq_per_s": 515.56,
  "bases_per_s": 412451,
  "dtype": "float32",
  "device": "npu:0",
  "model_params_m": 0.211
}

自验证截图

Agent workflow

NPU device call

Model result

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

已知限制

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

标签

#NPU #Ascend #Ascend910