m
mengsihan/aimnet2-rxn
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

isayevlab/aimnet2-rxn on Ascend NPU

模型与任务

  • 模型:isayevlab/aimnet2-rxn
  • Revision:13e9de20a1e878a18a371e94dfb2176629281cb6
  • 适配路线:reaction-modeling
  • 设备:npu:0

环境依赖

{
  "torch": "2.9.0",
  "torch_npu": "2.9.0.post1",
  "npu_name": "Ascend910_9362",
  "device_count": 2,
  "aimnet": "0.2.0",
  "warp": "1.16.0",
  "dtype": "float32 (NPU float fallback for double)",
  "python": "3.11"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "fixtures": [
    {
      "name": "ethanol",
      "numbers": [
        6,
        6,
        8,
        1,
        1,
        1,
        1,
        1,
        1
      ],
      "atoms": 9,
      "coord_units": "Angstrom",
      "charge": 0,
      "sha256": "ddbfecae"
    },
    {
      "name": "dme",
      "numbers": [
        6,
        8,
        6,
        1,
        1,
        1,
        1,
        1,
        1
      ],
      "atoms": 9,
      "coord_units": "Angstrom",
      "charge": 0,
      "sha256": "820edfdb"
    },
    {
      "name": "methane",
      "numbers": [
        6,
        1,
        1,
        1,
        1
      ],
      "atoms": 5,
      "coord_units": "Angstrom",
      "charge": 0,
      "sha256": "1256b344"
    }
  ],
  "total_atoms": 23,
  "batch": 1,
  "dtype": "float32",
  "units": "Angstrom/eV/e",
  "source": "synthetic ethanol/DME isomers same C2H6O stoichiometry, methane equilibrium, SHA256 recorded"
}

真实推理结果

{
  "energy_units": "eV (learned shifted electronic scale)",
  "forces_units": "eV/A",
  "charges_units": "e",
  "ethanol_energy_eV": 8.013626,
  "dme_energy_eV": 8.423762,
  "methane_energy_eV": -0.592065,
  "reaction_energy_DME_minus_ethanol_eV": 0.410136,
  "ordering": "ethanol<dme",
  "energy_shape": [
    1
  ],
  "forces_shape": "[N,3]",
  "charges_shape": "[N]",
  "device_proof": "param npu:0, output npu:0, torch.npu.synchronize() timing"
}

CPU-NPU 一致性

{
  "method": "CPU (double) vs NPU (float) same weights, coords, charge, compile_model=False, hybrid CPU-NPU with warp fallback",
  "ethanol_energy_max_abs_diff_eV": 0.009582412,
  "ethanol_energy_max_abs_diff_meV": 9.582,
  "dme_energy_max_abs_diff_eV": 0.01297058,
  "dme_energy_max_abs_diff_meV": 12.971,
  "methane_energy_max_abs_diff_eV": 0.00316115,
  "methane_energy_max_abs_diff_meV": 3.161,
  "max_energy_diff_meV": 12.971,
  "reaction_energy_diff_eV": 0.003388168,
  "ordering_consistent": true,
  "threshold_meV": 50,
  "status": "PASS",
  "note": "Forces diff larger due to NPU float vs CPU double and autograd through GELU; scalar energies are primary for reaction-modeling"
}

性能

{
  "avg_latency_ms_per_reaction": 19.4,
  "throughput_reactions_per_s": 51.5,
  "atoms_per_s": 463.5,
  "batch": 1,
  "dtype": "float32",
  "device": "npu:0",
  "repeats": 20,
  "warmup": 3,
  "peak_memory_MB": 3110,
  "synchronize": "torch.npu.synchronize() before/after"
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 仅对本次记录的模型 revision、输入契约、dtype 与 Ascend 环境完成验证。
  • Warp 邻居列表与 DFTD3 核在 NPU 上回退至 CPU 计算,模型核心在 NPU:0 上执行,已打印 device 证明。
  • NPU 不支持 double,已 cast 为 float,导致能量10 meV、力0.2-1.0 eV/A 差异,反应能排序一致。

标签

#NPU #Ascend #Ascend910