gcw_6a3w2yXz/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",
  "device_name": "Ascend910_9362",
  "cann": "8.5.1",
  "dtype": "float32"
}

安装:pip install -r requirements.txt

NPU 推理

默认执行:python inference.py

真实输入

{
  "reactions": 4,
  "species": 8,
  "atoms_total": 48,
  "units": {
    "coord": "Angstrom",
    "energy": "eV",
    "forces": "eV/A"
  }
}

真实推理结果

{
  "reactions": [
    {
      "reaction": "R1_HCN_HNC_isomerization",
      "reactant": "hcn",
      "product": "hnc",
      "dE_cpu_eV": 0.535675,
      "dE_npu_eV": 0.535675,
      "abs_diff_meV": 0.0002
    },
    {
      "reaction": "R2_CH3NC_CH3CN_isomerization",
      "reactant": "ch3nc",
      "product": "ch3cn",
      "dE_cpu_eV": -0.991048,
      "dE_npu_eV": -0.991045,
      "abs_diff_meV": 0.0031
    },
    {
      "reaction": "R3_water_dimer_association",
      "reactant": "water_dimer_far",
      "product": "water_dimer_hbond",
      "dE_cpu_eV": -0.115753,
      "dE_npu_eV": -0.115755,
      "abs_diff_meV": 0.0026
    },
    {
      "reaction": "R4_ethanol_DME_isomerization",
      "reactant": "ethanol",
      "product": "dimethyl_ether",
      "dE_cpu_eV": -7.617877,
      "dE_npu_eV": -7.617882,
      "abs_diff_meV": 0.0046
    }
  ],
  "ranking_cpu": [
    "R4_ethanol_DME_isomerization",
    "R2_CH3NC_CH3CN_isomerization",
    "R3_water_dimer_association",
    "R1_HCN_HNC_isomerization"
  ],
  "ranking_npu": [
    "R4_ethanol_DME_isomerization",
    "R2_CH3NC_CH3CN_isomerization",
    "R3_water_dimer_association",
    "R1_HCN_HNC_isomerization"
  ]
}

CPU-NPU 一致性

{
  "values": {
    "reaction_energy_max_meV": 0.0046,
    "force_max_meV_per_A": 0.042737,
    "force_mean_meV_per_A": 0.012902,
    "force_cosine_min": 0.999957,
    "charge_max_me": 1e-06
  },
  "thresholds": {
    "reaction_energy_max_meV": {
      "limit": 5.0
    },
    "force_max_meV_per_A": {
      "limit": 10.0
    },
    "force_mean_meV_per_A": {
      "limit": 2.0
    },
    "force_cosine_min": {
      "limit": 0.999
    },
    "charge_max_me": {
      "limit": 0.005
    }
  },
  "checks": {
    "reaction_energy_max_meV": true,
    "force_max_meV_per_A": true,
    "force_mean_meV_per_A": true,
    "force_cosine_min": true,
    "charge_max_me": true,
    "ranking_identical": true,
    "forward_reverse_antisymmetric": true,
    "all_outputs_finite": true,
    "npu_charge_neutral": true
  },
  "cosine_atoms": 43
}

性能

{
  "reactions_per_s": 25.34,
  "atoms_per_s": 304.1,
  "iterations": 10,
  "peak_npu_memory_MiB": 46.4
}

自验证截图

Agent workflow

NPU device call

Model result

已知限制

  • 验证针对固定 revision 与本机 Ascend 环境;能量为模型自身移标尺度,仅同族内差值有意义。
  • 邻居表在宿主 CPU 用官方 nvalchemiops 内核预计算后迁移至 NPU(warp 内核不支持 NPU 设备)。
  • torch_npu 的 GELU 内核为 tanh 近似,已与 CPU 侧统一替换为精确 erf-GELU 以保证力级一致性。
  • 按模型卡契约关闭外挂 DFTD3 色散(needs_dispersion=false),避免与训练参考中的 VV10 色散重复计入。
  • 单次冒烟一致性不构成完整精度评测;阈值基于 float32 跨设备实测制定。

标签

#NPU #Ascend #Ascend910