grace-runtime 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/.github/workflows/cpu-wheels.yml +2 -2
  2. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/CHANGELOG.md +37 -0
  3. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/PKG-INFO +7 -1
  4. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/README.md +6 -0
  5. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/benchmarks.md +5 -7
  6. grace_runtime-0.1.2/docs/images/benchmarks-atoms.png +0 -0
  7. grace_runtime-0.1.2/docs/images/benchmarks-time.png +0 -0
  8. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/index.md +6 -0
  9. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/lammps.md +3 -3
  10. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/models.md +16 -3
  11. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/fused_1l.h +2 -0
  12. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/fused_2l.h +3 -0
  13. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/fused_cpu.h +19 -51
  14. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/fused_common.h +5 -44
  15. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_1l_fused_kk.h +9 -0
  16. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_1l_fused_kk_impl.h +68 -16
  17. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_1l_kk.h +3 -2
  18. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_1l_kk_impl.h +15 -2
  19. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_2l_fused_kk.h +20 -0
  20. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_2l_fused_kk_impl.h +154 -47
  21. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_2l_kk.h +20 -2
  22. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_2l_kk_impl.h +48 -43
  23. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/support.h +16 -0
  24. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/model_1l.h +7 -0
  25. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/model_2l.h +15 -2
  26. grace_runtime-0.1.2/libgrace/include/grace/radial_x.h +62 -0
  27. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/fused_1l.cpp +15 -6
  28. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/fused_2l.cpp +17 -7
  29. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/model_1l.cpp +24 -0
  30. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/model_2l.cpp +60 -6
  31. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/model_3l.cpp +2 -0
  32. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/npz3.h +13 -1
  33. grace_runtime-0.1.2/libgrace/src/zero_pad.h +56 -0
  34. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/pyproject.toml +1 -1
  35. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/_gpu.py +14 -8
  36. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/calculator.py +9 -3
  37. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/models.json +37 -7
  38. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/kk/kk_api.h +2 -0
  39. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/kk/kk_core.cpp +20 -5
  40. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/kk/kk_module.cpp +2 -0
  41. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_parity.py +44 -2
  42. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace.py +3 -2
  43. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_ref_tf.py +16 -7
  44. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python-cuda/grace_runtime_cuda12/__init__.py +1 -1
  45. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python-cuda/pyproject.toml +2 -2
  46. grace_runtime-0.1.2/tests/fixtures/grace_1l_small.npz +0 -0
  47. grace_runtime-0.1.2/tests/fixtures/grace_2l_small.npz +0 -0
  48. grace_runtime-0.1.2/tests/fixtures/legacy_1l_wide.npz +0 -0
  49. grace_runtime-0.1.2/tests/fixtures/legacy_2l_small.npz +0 -0
  50. grace_runtime-0.1.2/tests/fixtures/legacy_2l_wide.npz +0 -0
  51. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_driver.cpp +38 -0
  52. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_model_load.cpp +3 -1
  53. grace_runtime-0.1.1/docs/images/benchmarks-cpu-dark.png +0 -0
  54. grace_runtime-0.1.1/docs/images/benchmarks-cpu-light.png +0 -0
  55. grace_runtime-0.1.1/docs/images/benchmarks-gpu-dark.png +0 -0
  56. grace_runtime-0.1.1/docs/images/benchmarks-gpu-light.png +0 -0
  57. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/.github/workflows/cuda-wheels.yml +0 -0
  58. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/.github/workflows/release.yml +0 -0
  59. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/.github/workflows/rocm-wheels.yml +0 -0
  60. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/.gitignore +0 -0
  61. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/.readthedocs.yaml +0 -0
  62. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/CMakeLists.txt +0 -0
  63. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/LICENSE.md +0 -0
  64. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/THIRD_PARTY_NOTICES.md +0 -0
  65. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/cmake/GraceHipAtomics.cmake +0 -0
  66. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/cmake/GraceRuntime.cmake +0 -0
  67. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/advanced.md +0 -0
  68. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/api.md +0 -0
  69. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/backends.md +0 -0
  70. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/development.md +0 -0
  71. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/dispersion.md +0 -0
  72. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/hooks/api_reference.py +0 -0
  73. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/installation.md +0 -0
  74. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/pace.md +0 -0
  75. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/properties.md +0 -0
  76. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/relax.md +0 -0
  77. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/requirements.txt +0 -0
  78. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/torchsim.md +0 -0
  79. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/docs/usage.md +0 -0
  80. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/bonds.h +0 -0
  81. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/cell_list.h +0 -0
  82. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/coupling.h +0 -0
  83. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/cpu_gemm.h +0 -0
  84. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/cpu_simd.h +0 -0
  85. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/d3.h +0 -0
  86. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/d3_params.h +0 -0
  87. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/dispersion.h +0 -0
  88. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/error.h +0 -0
  89. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/fused_3l.h +0 -0
  90. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/fused_3l_cpu.h +0 -0
  91. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/fused_cpu_types.h +0 -0
  92. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/hd.h +0 -0
  93. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/blas.h +0 -0
  94. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/csr_images.h +0 -0
  95. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/cublas_guard.h +0 -0
  96. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/d3_kk.h +0 -0
  97. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/fused_dense.h +0 -0
  98. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/fused_hip_bonds.h +0 -0
  99. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/g1l_shape_large.h +0 -0
  100. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/g2l_shape_smaxl.h +0 -0
  101. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/g2l_shape_smaxm.h +0 -0
  102. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_fused_kk.h +0 -0
  103. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk.h +0 -0
  104. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_cpl.h +0 -0
  105. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_cpl_path.h +0 -0
  106. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_dense.h +0 -0
  107. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_impl.h +0 -0
  108. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_radial.h +0 -0
  109. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_spbf.h +0 -0
  110. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/grace_3l_kk_spbf_mfma.h +0 -0
  111. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/kk_gemm.h +0 -0
  112. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/kk_mfma.h +0 -0
  113. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/neighbors_kk.h +0 -0
  114. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/pace_kk.h +0 -0
  115. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/rocblas_guard.h +0 -0
  116. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/kk/traits.h +0 -0
  117. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/model_3l.h +0 -0
  118. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/model_kind.h +0 -0
  119. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/pace_cpu.h +0 -0
  120. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/pace_embedding.h +0 -0
  121. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/pace_model.h +0 -0
  122. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/pace_radial.h +0 -0
  123. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/pace_tables.h +0 -0
  124. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/system.h +0 -0
  125. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/type_map.h +0 -0
  126. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/uq.h +0 -0
  127. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/include/grace/uq_head.h +0 -0
  128. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/fused_3l.cpp +0 -0
  129. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/model_kind.cpp +0 -0
  130. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_convert.cpp +0 -0
  131. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_convert.h +0 -0
  132. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_cpu.cpp +0 -0
  133. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_model.cpp +0 -0
  134. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_tables.cpp +0 -0
  135. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_yaml.cpp +0 -0
  136. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/pace_yaml.h +0 -0
  137. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/uq.cpp +0 -0
  138. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/src/uq_head.cpp +0 -0
  139. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/third_party/d3_data/LICENSE +0 -0
  140. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/third_party/grace_cnpy/LICENSE +0 -0
  141. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/third_party/grace_cnpy/cnpy.cpp +0 -0
  142. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/libgrace/third_party/grace_cnpy/cnpy.h +0 -0
  143. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/mkdocs.yml +0 -0
  144. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/CMakeLists.txt +0 -0
  145. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/LICENSE-libomp +0 -0
  146. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/ase/grace_runtime_ase.ipynb +0 -0
  147. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/phonons/phonons_batch.py +0 -0
  148. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/relax/solute_vacancy_relax.py +0 -0
  149. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/torchsim/_models.py +0 -0
  150. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/torchsim/elastic_batch.py +0 -0
  151. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/torchsim/solute_vacancy_relax.py +0 -0
  152. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/torchsim/temperature_scan.py +0 -0
  153. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/examples/torchsim/uq_md_ensemble.py +0 -0
  154. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/__init__.py +0 -0
  155. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/_core.py +0 -0
  156. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/_cuda.py +0 -0
  157. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/_dispatch.py +0 -0
  158. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/_rocm.py +0 -0
  159. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/batch.py +0 -0
  160. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/cli.py +0 -0
  161. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/dispersion.py +0 -0
  162. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/neighbors.py +0 -0
  163. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/phonons.py +0 -0
  164. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/properties.py +0 -0
  165. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/registry.py +0 -0
  166. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/relax.py +0 -0
  167. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/grace_runtime/torchsim.py +0 -0
  168. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/kk/CMakeLists.txt +0 -0
  169. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/kk/kk_core_3l.cpp +0 -0
  170. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/src/core.cpp +0 -0
  171. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/src/dispersion_args.h +0 -0
  172. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/src/exports.map +0 -0
  173. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/src/neighbors.cpp +0 -0
  174. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/src/neighbors.h +0 -0
  175. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/conftest.py +0 -0
  176. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/d3_ref.py +0 -0
  177. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/gate_cells.py +0 -0
  178. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/gpu_tools.py +0 -0
  179. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/model_tools.py +0 -0
  180. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/pace_tools.py +0 -0
  181. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_auto_device.py +0 -0
  182. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_batch.py +0 -0
  183. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_bond_source.py +0 -0
  184. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_calculator.py +0 -0
  185. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_compressed.py +0 -0
  186. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_core.py +0 -0
  187. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_cuda_plugin.py +0 -0
  188. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_d3.py +0 -0
  189. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_dispatch.py +0 -0
  190. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_docs_api.py +0 -0
  191. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_energy_only.py +0 -0
  192. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_examples.py +0 -0
  193. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_alloc_failure.py +0 -0
  194. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_batch.py +0 -0
  195. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_batch_device.py +0 -0
  196. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_calculator.py +0 -0
  197. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_chunk.py +0 -0
  198. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_d3.py +0 -0
  199. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_memory.py +0 -0
  200. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_module.py +0 -0
  201. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_pace.py +0 -0
  202. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_pace_uq.py +0 -0
  203. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_properties.py +0 -0
  204. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_relax.py +0 -0
  205. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_gpu_several_calculators.py +0 -0
  206. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_neighbors.py +0 -0
  207. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace_calculator.py +0 -0
  208. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace_ctilde.py +0 -0
  209. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace_npz.py +0 -0
  210. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace_radial.py +0 -0
  211. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace_spec.py +0 -0
  212. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_pace_uq.py +0 -0
  213. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_phonons.py +0 -0
  214. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_properties.py +0 -0
  215. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_registry.py +0 -0
  216. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_relax.py +0 -0
  217. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_rocm_plugin.py +0 -0
  218. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_runtimes.py +0 -0
  219. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_symmetry.py +0 -0
  220. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_torchsim.py +0 -0
  221. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_uq.py +0 -0
  222. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python/tests/test_vs_tp.py +0 -0
  223. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python-cuda/CMakeLists.txt +0 -0
  224. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python-cuda/LICENSE-Kokkos +0 -0
  225. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/python-cuda/README.md +0 -0
  226. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/coupling_ref.h +0 -0
  227. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/d3_ref.h +0 -0
  228. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/W2tri.data +0 -0
  229. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/W2tri.npz +0 -0
  230. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/W54.data +0 -0
  231. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/W54.npz +0 -0
  232. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/WMo54.data +0 -0
  233. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/WMo54.npz +0 -0
  234. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/d3_ref.npz +0 -0
  235. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/al_fs_plain.yaml +0 -0
  236. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/au_chebpow_density.yaml +0 -0
  237. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/au_dist_corerep.yaml +0 -0
  238. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/carbon_zbl.yaml +0 -0
  239. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/cells.extxyz +0 -0
  240. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/ethanol_nd1.yaml +0 -0
  241. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/ho_nd5.yaml +0 -0
  242. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/mnbtw_4el.yaml +0 -0
  243. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/ni_lmax6.yaml +0 -0
  244. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/pace/pdh_zbl.yaml +0 -0
  245. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W2tri_1l.dump +0 -0
  246. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W2tri_1l.thermo +0 -0
  247. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W2tri_2l.dump +0 -0
  248. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W2tri_2l.thermo +0 -0
  249. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W2tri_3l.dump +0 -0
  250. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W2tri_3l.thermo +0 -0
  251. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W54_1l.dump +0 -0
  252. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W54_1l.thermo +0 -0
  253. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W54_2l.dump +0 -0
  254. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W54_2l.thermo +0 -0
  255. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W54_3l.dump +0 -0
  256. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/W54_3l.thermo +0 -0
  257. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/WMo54_1l.dump +0 -0
  258. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/WMo54_1l.thermo +0 -0
  259. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/WMo54_2l.dump +0 -0
  260. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/WMo54_2l.thermo +0 -0
  261. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/WMo54_3l.dump +0 -0
  262. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref/WMo54_3l.thermo +0 -0
  263. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_cpl/WMo54_1l.txt +0 -0
  264. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_cpl/WMo54_2l.txt +0 -0
  265. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_cpl/WMo54_3l.txt +0 -0
  266. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_1l_fused.dump +0 -0
  267. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_1l_fused.thermo +0 -0
  268. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_1l_kk.dump +0 -0
  269. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_1l_kk.thermo +0 -0
  270. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_2l_fused.dump +0 -0
  271. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_2l_fused.thermo +0 -0
  272. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_2l_kk.dump +0 -0
  273. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_2l_kk.thermo +0 -0
  274. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_3l_kk.dump +0 -0
  275. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W2tri_3l_kk.thermo +0 -0
  276. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_1l_fused.dump +0 -0
  277. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_1l_fused.thermo +0 -0
  278. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_1l_kk.dump +0 -0
  279. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_1l_kk.thermo +0 -0
  280. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_2l_fused.dump +0 -0
  281. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_2l_fused.thermo +0 -0
  282. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_2l_kk.dump +0 -0
  283. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_2l_kk.thermo +0 -0
  284. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_3l_kk.dump +0 -0
  285. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/W54_3l_kk.thermo +0 -0
  286. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_1l_fused.dump +0 -0
  287. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_1l_fused.thermo +0 -0
  288. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_1l_kk.dump +0 -0
  289. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_1l_kk.thermo +0 -0
  290. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_2l_fused.dump +0 -0
  291. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_2l_fused.thermo +0 -0
  292. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_2l_kk.dump +0 -0
  293. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_2l_kk.thermo +0 -0
  294. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_3l_kk.dump +0 -0
  295. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/fixtures/ref_gpu/WMo54_3l_kk.thermo +0 -0
  296. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/kk_csr_util.h +0 -0
  297. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_1l_compile.cpp +0 -0
  298. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_2l_compile.cpp +0 -0
  299. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_2l_large.cpp +0 -0
  300. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_3l_compile.cpp +0 -0
  301. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_coupling.cpp +0 -0
  302. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_csr.cpp +0 -0
  303. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_csr_3l.cpp +0 -0
  304. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_d3.cpp +0 -0
  305. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_device.cpp +0 -0
  306. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_gemm.cpp +0 -0
  307. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_large.cpp +0 -0
  308. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_launch_check.cpp +0 -0
  309. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/kk/test_kk_neighbors.cpp +0 -0
  310. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_bonds.cpp +0 -0
  311. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_coupling.cpp +0 -0
  312. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_d3.cpp +0 -0
  313. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_driver_uq.cpp +0 -0
  314. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_error.cpp +0 -0
  315. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_gemm.cpp +0 -0
  316. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_host_memory.cpp +0 -0
  317. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_kernels_compile.cpp +0 -0
  318. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_model_kind.cpp +0 -0
  319. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_model_limits.cpp +0 -0
  320. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_model_shapes.cpp +0 -0
  321. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_pace_yaml.cpp +0 -0
  322. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_uq.cpp +0 -0
  323. {grace_runtime-0.1.1 → grace_runtime-0.1.2}/tests/test_util.h +0 -0
@@ -52,7 +52,7 @@ jobs:
52
52
  matrix:
53
53
  platform:
54
54
  - {artifact: cpu-wheels, os: ubuntu-latest, mamba: linux-64}
55
- - {artifact: cpu-wheels-macos-arm64, os: macos-14, mamba: osx-arm64}
55
+ - {artifact: cpu-wheels-macos-arm64, os: macos-15, mamba: osx-arm64}
56
56
  runs-on: ${{ matrix.platform.os }}
57
57
  timeout-minutes: 120
58
58
  steps:
@@ -81,7 +81,7 @@ jobs:
81
81
  matrix:
82
82
  platform:
83
83
  - {artifact: cpu-wheels, os: ubuntu-latest, mamba: linux-64}
84
- - {artifact: cpu-wheels-macos-arm64, os: macos-14, mamba: osx-arm64}
84
+ - {artifact: cpu-wheels-macos-arm64, os: macos-15, mamba: osx-arm64}
85
85
  python: ["3.10", "3.11", "3.12", "3.13"]
86
86
  runs-on: ${{ matrix.platform.os }}
87
87
  timeout-minutes: 120
@@ -3,6 +3,43 @@
3
3
  Notable changes of grace-runtime, grace-runtime-cuda12 and grace-runtime-rocm6 (they share one version). Each
4
4
  release has a section "Changed defaults" when a default behaves differently.
5
5
 
6
+ ## [0.1.2](https://github.com/ICAMS/grace-runtime/releases/tag/0.1.2) (2026-11-01)
7
+
8
+ The early GRACE-1L/2L models, and fast GPU kernels for more GRACE-1L/2L fits.
9
+
10
+ ### Added
11
+
12
+ - **Early GRACE-1L/2L models:** GRACE-1L-OAM, GRACE-1L-OMAT, GRACE-2L-OAM and GRACE-2L-OMAT (and their older aliases)
13
+ are in the registry and run on the CPU, NVIDIA and AMD GPUs, in Python and in LAMMPS, without an uncertainty head.
14
+ Own fits of the early GRACE-1L/2L presets run as well: tensorpotential exports them as `kokkos.npz` format 2.
15
+ - **More GRACE-1L/2L fits on the fast GPU kernels.** A fit whose layers are narrower than compiled GPU kernels runs
16
+ zero-padded to them, with the same results and a warning that names the widths (not models with an uncertainty
17
+ head). GRACE-2L has kernels for the widths of the current registry models, of the early ones, and of fits with 48
18
+ layer-2 radial channels; GRACE-1L fits run with up to 64 radial channels. The models guide lists the widths.
19
+ - `GRACE_GENERIC_KERNELS=1`: a GRACE-2L fit wider than all compiled GPU kernels runs on generic GPU kernels, several
20
+ times slower, with a warning. Without the variable such a fit stops with an error that names its widths.
21
+
22
+ ### LAMMPS (`grace-runtime` branch of the LAMMPS fork)
23
+
24
+ - `grace/runtime` and `grace/runtime/kk` run the early GRACE-1L/2L models and own fits of their presets. The Kokkos
25
+ style pads narrower fits like Python does, and with `GRACE_GENERIC_KERNELS=1` runs wider GRACE-2L fits on the
26
+ generic GPU kernels. Warnings appear as LAMMPS `WARNING` lines.
27
+
28
+ ### Documentation
29
+
30
+ - Benchmarks: H200, MI250X, L40S and CPU charts; the front page shows the execution speed.
31
+ - Models: which fits run on the fast GPU kernels, padded or not, and `GRACE_GENERIC_KERNELS`.
32
+
33
+ ### Changed defaults
34
+
35
+ - A GRACE-1L/2L model without GPU kernels of its own widths stopped with an error on a GPU. A narrower one now runs
36
+ zero-padded with a warning; a wider GRACE-2L one still stops, and the error names `GRACE_GENERIC_KERNELS=1`.
37
+ - `device="auto"`: such a wider GRACE-2L model raises instead of running on the CPU.
38
+ - `kokkos.npz` format version 2 for the early GRACE-1L/2L layouts. grace-runtime 0.1.1 and older refuse these files
39
+ and ask for an update. Files of current models stay format 1.
40
+ - The GPU modules of `grace-runtime-cuda12` / `grace-runtime-rocm6` 0.1.2 have interface version 7; grace-runtime
41
+ 0.1.2 refuses older modules. The packages pin each other, so a normal `pip install` matches them.
42
+
6
43
  ## [0.1.1](https://github.com/ICAMS/grace-runtime/releases/tag/0.1.1) (2026-10-29)
7
44
 
8
45
  Bug fixes and documentation.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: grace-runtime
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Fast CPU and GPU inference of GRACE and PACE interatomic potentials with ASE, batching and TorchSim
5
5
  License: Academic Software License (ASL); bundled third-party code: see THIRD_PARTY_NOTICES.md
6
6
  Classifier: License :: Other/Proprietary License
@@ -28,6 +28,12 @@ CPU execution is standalone; GPU execution uses Kokkos for NVIDIA CUDA and AMD H
28
28
  Use ASE-compatible calculators, batch processing, an optional TorchSim adapter or the shared kernels in LAMMPS with MPI.
29
29
  PACE (ACE) potentials fitted with pacemaker run from their `.yaml` ([PACE models](https://github.com/ICAMS/grace-runtime/blob/master/docs/pace.md)).
30
30
 
31
+ One call computes energy, forces and stress. On one NVIDIA H200 that takes about 1 µs per atom for GRACE-1L,
32
+ 3.5 µs for GRACE-2L and 13 µs for GRACE-3L (large OMAT models); a 16-core Xeon is 5 to 13 times slower.
33
+ [Benchmarks](https://github.com/ICAMS/grace-runtime/blob/master/docs/benchmarks.md) gives the setup and the largest system per GPU.
34
+
35
+ ![Time per atom for GRACE-1L, 2L and 3L on NVIDIA H200, AMD MI250X, NVIDIA L40S and a 16-core Xeon](https://raw.githubusercontent.com/ICAMS/grace-runtime/master/docs/images/benchmarks-time.png)
36
+
31
37
  **[Read the manual](https://github.com/ICAMS/grace-runtime/blob/master/docs/index.md)** · [Installation](https://github.com/ICAMS/grace-runtime/blob/master/docs/installation.md) · [API reference](https://github.com/ICAMS/grace-runtime/blob/master/docs/api.md)
32
38
 
33
39
  ## Install
@@ -5,6 +5,12 @@ CPU execution is standalone; GPU execution uses Kokkos for NVIDIA CUDA and AMD H
5
5
  Use ASE-compatible calculators, batch processing, an optional TorchSim adapter or the shared kernels in LAMMPS with MPI.
6
6
  PACE (ACE) potentials fitted with pacemaker run from their `.yaml` ([PACE models](https://github.com/ICAMS/grace-runtime/blob/master/docs/pace.md)).
7
7
 
8
+ One call computes energy, forces and stress. On one NVIDIA H200 that takes about 1 µs per atom for GRACE-1L,
9
+ 3.5 µs for GRACE-2L and 13 µs for GRACE-3L (large OMAT models); a 16-core Xeon is 5 to 13 times slower.
10
+ [Benchmarks](https://github.com/ICAMS/grace-runtime/blob/master/docs/benchmarks.md) gives the setup and the largest system per GPU.
11
+
12
+ ![Time per atom for GRACE-1L, 2L and 3L on NVIDIA H200, AMD MI250X, NVIDIA L40S and a 16-core Xeon](https://raw.githubusercontent.com/ICAMS/grace-runtime/master/docs/images/benchmarks-time.png)
13
+
8
14
  **[Read the manual](https://github.com/ICAMS/grace-runtime/blob/master/docs/index.md)** · [Installation](https://github.com/ICAMS/grace-runtime/blob/master/docs/installation.md) · [API reference](https://github.com/ICAMS/grace-runtime/blob/master/docs/api.md)
9
15
 
10
16
  ## Install
@@ -2,11 +2,9 @@
2
2
 
3
3
  How fast grace-runtime evaluates the GRACE foundation models, and how many atoms fit on one GPU.
4
4
 
5
- ![Time per atom and largest system on one GPU, for GRACE-1L, 2L and 3L on NVIDIA L40S, NVIDIA A100 and AMD MI250X](images/benchmarks-gpu-light.png#only-light)
6
- ![Time per atom and largest system on one GPU, for GRACE-1L, 2L and 3L on NVIDIA L40S, NVIDIA A100 and AMD MI250X](images/benchmarks-gpu-dark.png#only-dark)
5
+ ![Time per atom for GRACE-1L, 2L and 3L on NVIDIA H200, AMD MI250X, NVIDIA L40S and a 16-core Xeon](images/benchmarks-time.png)
7
6
 
8
- ![Time per atom on one CPU with 1 and 16 cores, for GRACE-1L, 2L and 3L](images/benchmarks-cpu-light.png#only-light)
9
- ![Time per atom on one CPU with 1 and 16 cores, for GRACE-1L, 2L and 3L](images/benchmarks-cpu-dark.png#only-dark)
7
+ ![Largest system on one GPU for GRACE-1L, 2L and 3L on NVIDIA H200, AMD MI250X and NVIDIA L40S](images/benchmarks-atoms.png)
10
8
 
11
9
  ## How we measured
12
10
 
@@ -15,8 +13,8 @@ How fast grace-runtime evaluates the GRACE foundation models, and how many atoms
15
13
  | Models | GRACE-1L-OMAT-large-base, GRACE-2L-OMAT-large-base, GRACE-3L-OMAT-large (cutoff 6 Å) |
16
14
  | System | bcc crystal (a = 3.165 Å) with 25 elements (Al to Os) in random order, atoms displaced by about 0.02 Å; about 58 neighbours per atom |
17
15
  | Calculation | `GRACERuntimeCalculator` with default settings; each call computes energy, forces and stress |
18
- | Time per atom | median of 3 calls after the first; the lowest value over system sizes from about 1000 atoms up. It changes little above about 16000 atoms (GPU) or 2000 atoms (CPU) |
16
+ | Time per atom | median of 3 calls after the first; the lowest value over system sizes from about 1000 atoms up. It changes little above about 16000 atoms (GPU) or 2000 atoms (CPU). H200: lowest of 31,250 and 128,000 atoms |
19
17
  | Largest system | double the number of atoms until a structure does not fit the GPU memory, then bisect; the largest structure that runs, each size in a new process |
20
- | GPUs | NVIDIA L40S 48 GB, NVIDIA A100 80 GB PCIe, AMD Instinct MI250X: one GCD (half of the card) with 64 GB |
21
- | CPU | Intel Xeon Gold 6526Y (16 cores per socket); 1 thread, or 16 threads on one socket (`OMP_NUM_THREADS`) |
18
+ | GPUs | NVIDIA H200 NVL 141 GB, NVIDIA L40S 48 GB, AMD Instinct MI250X: one GCD (half of the card) with 64 GB |
19
+ | CPU | Intel Xeon Gold 6526Y (16 cores per socket); 16 threads on one socket (`OMP_NUM_THREADS`) |
22
20
  | Software | grace-runtime 0.1 wheels from PyPI (`grace-runtime`, `grace-runtime-cuda12`, `grace-runtime-rocm6`) |
@@ -4,6 +4,12 @@ Run GRACE-1L, GRACE-2L and GRACE-3L interatomic potentials on CPU or GPU without
4
4
  CPU execution is standalone; GPU execution uses Kokkos for NVIDIA CUDA and AMD HIP.
5
5
  The kernels also run in LAMMPS, with MPI support.
6
6
 
7
+ One call computes energy, forces and stress. On one NVIDIA H200 that takes about 1 µs per atom for GRACE-1L,
8
+ 3.5 µs for GRACE-2L and 13 µs for GRACE-3L (large OMAT models); a 16-core Xeon is 5 to 13 times slower.
9
+ [Benchmarks](benchmarks.md) gives the setup and the largest system per GPU.
10
+
11
+ ![Time per atom for GRACE-1L, 2L and 3L on NVIDIA H200, AMD MI250X, NVIDIA L40S and a 16-core Xeon](images/benchmarks-time.png)
12
+
7
13
  Start with [installation](installation.md), then try a calculation below.
8
14
  The optional TorchSim adapter requires PyTorch and TorchSim.
9
15
 
@@ -30,7 +30,7 @@ cd lammps
30
30
  ## 2. Build
31
31
 
32
32
  The pair styles are part of the `ML-PACE` package. When CMake configures the build, it downloads grace-runtime
33
- 0.1.1 from GitHub, so the configure step needs network access. It also downloads the ML-PACE library. Pick one of the
33
+ 0.1.2 from GitHub, so the configure step needs network access. It also downloads the ML-PACE library. Pick one of the
34
34
  three recipes; run each from the `lammps` folder.
35
35
 
36
36
  ### CPU
@@ -131,10 +131,10 @@ Other AMD GPUs ([GPU backends](backends.md#amd-rocm)):
131
131
 
132
132
  ### Without network access
133
133
 
134
- Download grace-runtime 0.1.1 on a machine with network access, copy it over and pass its path:
134
+ Download grace-runtime 0.1.2 on a machine with network access, copy it over and pass its path:
135
135
 
136
136
  ```bash
137
- git clone --depth 1 -b 0.1.1 https://github.com/ICAMS/grace-runtime.git
137
+ git clone --depth 1 -b 0.1.2 https://github.com/ICAMS/grace-runtime.git
138
138
  cmake -S cmake -B build-cpu ... -D LOCAL_GRACE_RUNTIME=$PWD/grace-runtime
139
139
  ```
140
140
 
@@ -12,9 +12,9 @@ grace-runtime models download GRACE-2L-OMAT-medium-ft-E
12
12
  ```
13
13
 
14
14
  OMAT models use a 6 Å cutoff; SMAX variants use element-dependent cutoffs of 5–7.5 Å.
15
- Older registry aliases are accepted. Legacy GRACE-FS and early OAM/OMAT models without a Kokkos export require
16
- tensorpotential's `TPCalculator` instead. PACE (ACE) models fitted with pacemaker run from their `.yaml`: see
17
- [PACE models](pace.md).
15
+ Older registry aliases are accepted. The early models GRACE-1L-OAM, GRACE-1L-OMAT, GRACE-2L-OAM and GRACE-2L-OMAT
16
+ run as well, without an uncertainty head. Legacy GRACE-FS models require tensorpotential's `TPCalculator`. PACE (ACE) models fitted
17
+ with pacemaker run from their `.yaml`: see [PACE models](pace.md).
18
18
 
19
19
  To use your own model, export it with tensorpotential and pass the resulting file:
20
20
 
@@ -22,6 +22,19 @@ To use your own model, export it with tensorpotential and pass the resulting fil
22
22
  grace_utils -p model.yaml -c CHECKPOINT export_kokkos -o model.npz
23
23
  ```
24
24
 
25
+ Fits of the early GRACE-1L/2L presets export the same way. Their files are format 2; an older grace-runtime refuses
26
+ them and asks for an update.
27
+
28
+ On a GPU, GRACE-2L fits up to the widths of the registry models run on the fast kernels, narrower layers zero-padded
29
+ with the same results and a warning (lmax at most 4; not models with an uncertainty head): a fit of the current presets
30
+ with at most 42 layer-1 and 32 layer-2 radial channels, 64 layer-2 product functions and `n_mlp_dens` at most 16, and
31
+ any fit with at most 32 layer-1 and 48 layer-2 radial channels, 48 layer-2 product functions and `n_mlp_dens` at most
32
+ 12. GRACE-1L fits with up to 64 radial channels and FC outputs run zero-padded the same way. Wider GRACE-2L fits stop
33
+ with an error that names their widths, also with `device="auto"`; with `GRACE_GENERIC_KERNELS=1` set in the environment
34
+ they run on generic GPU kernels, several times slower, with a warning. Please open an
35
+ [issue](https://github.com/ICAMS/grace-runtime/issues) with the widths the message names so that fast kernels can be
36
+ added.
37
+
25
38
  After exporting `model.npz`, load it with:
26
39
 
27
40
  ```python
@@ -77,6 +77,8 @@ class Grace1LFused {
77
77
  std::vector<double> e_norm;
78
78
  std::vector<int> e_nin, e_nout;
79
79
  int e_act = 0;
80
+ bool e_ln = false; // legacy models: RMS layer norm of the MLP input (ln_fwd)
81
+ bool aaa_a = false; // legacy models: AAA = AA1 x A (else AA1 x A1)
80
82
  double out_scale = 1.0;
81
83
 
82
84
  std::vector<int> order, bstart, bcount;
@@ -117,10 +117,13 @@ class Grace2LFused {
117
117
 
118
118
  // RMSNorms + energy MLP (double)
119
119
  std::vector<double> lnI_scale, ln0_scale;
120
+ bool rms = true; // the RMSNorms (off: legacy models, unit scales)
121
+ int nrms1 = 0, nrms0 = 0; // the RMS means of rho[1:] / I2 divide by these (padded model: the unpadded widths)
120
122
  std::vector<std::vector<double>> eW;
121
123
  std::vector<double> e_norm;
122
124
  std::vector<int> e_nin, e_nout;
123
125
  int e_act = 1;
126
+ bool e_ln = false; // legacy models: RMS layer norm of the MLP input (ln_fwd)
124
127
  double out_scale = 1.0;
125
128
 
126
129
  // per-atom globals
@@ -243,57 +243,6 @@ inline float dot3(const float *__restrict x, const float *__restrict y, const fl
243
243
 
244
244
  inline void vzero(float *y, const size_t n) { std::memset(y, 0, n * sizeof(float)); }
245
245
 
246
- // fp64: Chebyshev T_1..T_nrb of (2x-1) times fcut_p(x), and d/dx
247
- inline void radial_basis_x(double x, int p, int nrb, std::vector<double> &g, std::vector<double> &dg)
248
- {
249
- const double xp = std::pow(x, p), xp1 = xp * x, xp2 = xp1 * x;
250
- const double fc = 1.0 - 0.5 * (p + 1) * (p + 2) * xp + p * (p + 2) * xp1 - 0.5 * p * (p + 1) * xp2;
251
- const double dfc = 0.5 * p * (p + 1) * (p + 2) * (-std::pow(x, p - 1) + 2.0 * xp - xp1);
252
- const double t = 2.0 * x - 1.0;
253
- double Tp = 1.0, Tc = t, dTp = 0.0, dTc = 2.0;
254
- g.resize(nrb);
255
- dg.resize(nrb);
256
- for (int k = 0; k < nrb; k++) {
257
- g[k] = Tc * fc;
258
- dg[k] = dTc * fc + Tc * dfc;
259
- const double Tn = 2.0 * t * Tc - Tp, dTn = 2.0 * (2.0 * Tc + t * dTc) - dTp;
260
- Tp = Tc; dTp = dTc; Tc = Tn; dTc = dTn;
261
- }
262
- }
263
-
264
- // fp64 forward-mode radial MLP (silu hidden layers, linear output)
265
- template<class Layers>
266
- void mlp_x(const Layers &layers, std::vector<double> h, std::vector<double> dh,
267
- std::vector<double> &out, std::vector<double> &dout)
268
- {
269
- const int n = layers.size();
270
- for (int il = 0; il < n; il++) {
271
- const auto &L = layers[il];
272
- std::vector<double> s(L.n_out, 0.0), ds(L.n_out, 0.0);
273
- for (int k = 0; k < L.n_in; k++)
274
- for (int j = 0; j < L.n_out; j++) {
275
- const double w = L.W[(size_t) k * L.n_out + j];
276
- s[j] += w * h[k];
277
- ds[j] += w * dh[k];
278
- }
279
- for (int j = 0; j < L.n_out; j++) {
280
- s[j] *= L.norm;
281
- ds[j] *= L.norm;
282
- if (il < n - 1) {
283
- const double sg = 1.0 / (1.0 + std::exp(-s[j]));
284
- ds[j] = sg * (1.0 + s[j] * (1.0 - sg)) * ds[j];
285
- s[j] = s[j] * sg;
286
- }
287
- }
288
- h.swap(s);
289
- dh.swap(ds);
290
- }
291
- out.swap(h);
292
- dout.swap(dh);
293
- }
294
-
295
-
296
-
297
246
  // 16-float vectors (one AVX-512 register, two halves on AVX2: grace_cpu_simd.h). Unaligned access.
298
247
  typedef simd::f16 v16;
299
248
  inline v16 ld(const float *p) { return simd::load(p); }
@@ -712,6 +661,25 @@ inline void red_bwd(const Red &R, int ty, const float *gOut, float *const *gX)
712
661
  default: break; \
713
662
  }
714
663
 
664
+ // legacy GRACE-1L/2L: the RMS layer norm z = x q of the energy-MLP input x[0..n) in place (its scale folded into the
665
+ // first layer), q = 1 / sqrt(mean x^2 + 1e-16) as tensorpotential's scalar_rms_ln; x0 keeps the input. Returns q.
666
+ inline double ln_fwd(double *x, double *x0, int n)
667
+ {
668
+ double ms = 0.0;
669
+ for (int k = 0; k < n; k++) ms += (x0[k] = x[k]) * x[k];
670
+ const double q = 1.0 / std::sqrt(ms / n + 1e-16);
671
+ for (int k = 0; k < n; k++) x[k] *= q;
672
+ return q;
673
+ }
674
+
675
+ // its reverse in place: g = dE/dz -> dE/dx
676
+ inline void ln_bwd(double *g, const double *x0, int n, double q)
677
+ {
678
+ double t = 0.0;
679
+ for (int k = 0; k < n; k++) t += g[k] * x0[k];
680
+ for (int k = 0; k < n; k++) g[k] = q * (g[k] - x0[k] * t * q * q / n);
681
+ }
682
+
715
683
  // ---- bond geometry: neighbours within the cutoff, unit vectors, real spherical harmonics Y[lm] and the
716
684
  // gradient G[lm][3] of their polynomial extension (dual numbers). Shared by the CPU GRACE-1L and 2L drivers.
717
685
 
@@ -19,6 +19,11 @@ namespace grace {
19
19
  namespace kk {
20
20
  namespace GraceFusedKK {
21
21
 
22
+ // the last sentence of the warnings for a model without GPU kernels of its own widths
23
+ constexpr const char *GRACE_KK_ISSUE =
24
+ "Please open an issue at https://github.com/ICAMS/grace-runtime/issues with these numbers so that fast kernels "
25
+ "can be added";
26
+
22
27
  constexpr int GRACE_FUSED_MAX_LMAX = 4;
23
28
 
24
29
  struct alignas(16) GF4 { float x, y, z, w; };
@@ -185,50 +190,6 @@ void spline_vd(const View3 &c, const int N, const float x, const int o, float &v
185
190
  dv = (a1 + t * (2.0f * a2 + t * 3.0f * a3)) * (float) N;
186
191
  }
187
192
 
188
- // Host fp64: Chebyshev T_1..T_nrb of (2x-1) times fcut_p(x), and d/dx (x = r / rcut_ij).
189
- inline void radial_basis_x(double x, int p, int nrb, std::vector<double> &g, std::vector<double> &dg)
190
- {
191
- const double xp = std::pow(x, p), xp1 = xp * x, xp2 = xp1 * x;
192
- const double fc = 1.0 - 0.5 * (p + 1) * (p + 2) * xp + p * (p + 2) * xp1 - 0.5 * p * (p + 1) * xp2;
193
- const double dfc = 0.5 * p * (p + 1) * (p + 2) * (-std::pow(x, p - 1) + 2.0 * xp - xp1);
194
- const double t = 2.0 * x - 1.0;
195
- double Tp = 1.0, Tc = t, dTp = 0.0, dTc = 2.0; // d/dx, chain factor 2
196
- g.resize(nrb); dg.resize(nrb);
197
- for (int k = 0; k < nrb; k++) {
198
- g[k] = Tc * fc;
199
- dg[k] = dTc * fc + Tc * dfc;
200
- const double Tn = 2.0 * t * Tc - Tp, dTn = 2.0 * (2.0 * Tc + t * dTc) - dTp;
201
- Tp = Tc; dTp = dTc; Tc = Tn; dTc = dTn;
202
- }
203
- }
204
-
205
- // Host fp64 forward-mode radial MLP (silu hidden layers, linear output), as TagComputeMLPRadial_R.
206
- template<class Layer>
207
- void mlp_x(const std::vector<Layer> &layers, std::vector<double> h,
208
- std::vector<double> dh, std::vector<double> &out, std::vector<double> &dout)
209
- {
210
- const int n = layers.size();
211
- for (int il = 0; il < n; il++) {
212
- const auto &L = layers[il];
213
- std::vector<double> s(L.n_out, 0.0), ds(L.n_out, 0.0);
214
- for (int k = 0; k < L.n_in; k++)
215
- for (int j = 0; j < L.n_out; j++) {
216
- const double w = L.W[(size_t) k * L.n_out + j];
217
- s[j] += w * h[k]; ds[j] += w * dh[k];
218
- }
219
- for (int j = 0; j < L.n_out; j++) {
220
- s[j] *= L.norm; ds[j] *= L.norm;
221
- if (il < n - 1) {
222
- const double sg = 1.0 / (1.0 + std::exp(-s[j]));
223
- ds[j] = sg * (1.0 + s[j] * (1.0 - sg)) * ds[j];
224
- s[j] = s[j] * sg;
225
- }
226
- }
227
- h.swap(s); dh.swap(ds);
228
- }
229
- out.swap(h); dout.swap(dh);
230
- }
231
-
232
193
  } // namespace GraceFusedKK
233
194
  } // namespace kk
234
195
  } // namespace grace
@@ -28,6 +28,15 @@ class Grace1LFusedKK : public Grace1LKK<DeviceType, float, float, Traits> {
28
28
 
29
29
  // checks the model against the compiled kernels, builds the dense metadata and the radial tables
30
30
  void setup() override;
31
+ // a model without UQ whose radial or FC width has no compiled kernels runs zero-padded (GRACE1LModel::padded: the
32
+ // same results), with a warning
33
+ void set_model(std::shared_ptr<GRACE1LModel> model, const std::vector<int> &type2mu) override;
34
+ // the widths {radial channels, FC outputs} set_model pads a model to; {0, 0}: none
35
+ static std::array<int, 2> pad_widths(const GRACE1LModel &m);
36
+ // the model zero-padded to its pad_widths; the model itself without them
37
+ static std::shared_ptr<GRACE1LModel> padded_model(std::shared_ptr<GRACE1LModel> model);
38
+ // the warning for a model that runs zero-padded; empty otherwise
39
+ static std::string slow_notice(const GRACE1LModel &m);
31
40
  typename Base::RunOutput run(const typename Base::RunInput &in) override;
32
41
  void release_buffers() override
33
42
  {
@@ -6,6 +6,7 @@
6
6
  #include "grace/kk/grace_1l_kk_impl.h"
7
7
  #include "grace/kk/fused_common.h"
8
8
  #include "grace/kk/fused_dense.h"
9
+ #include "grace/radial_x.h"
9
10
  #include "grace/kk/fused_hip_bonds.h"
10
11
  #include "grace/kk/g1l_shape_large.h"
11
12
 
@@ -28,8 +29,10 @@ constexpr int G1LF_MAX_ACC = 16; // per-thread accumulators: nradmax * nlm <=
28
29
  constexpr int G1LF_NO = 64; // FC widths compiled for: 64 (GRACE-1L large) and 32 (medium)
29
30
  constexpr int G1LF_NO_M = 32;
30
31
  constexpr int G1LF_NIN = 64; // max channel width of the rho sources
31
- constexpr int G1LF_NIR = 32; // max right-input (A) width of the FCs
32
+ constexpr int G1LF_NIR = 32; // right-input (A) width of the generic reverse FC (32 and 64: fc_bwd_rt)
33
+ constexpr int G1LF_NRMAX = 64; // max radial width (zero-padded to 32 or 64 when the kernels need it)
32
34
  constexpr int G1LF_CC = 8; // rho connections per thread (forward)
35
+ constexpr int G1LF_RQ = 5; // rho output quads: rho_n_out <= 20 (17; legacy models 13), weights padded to 20
33
36
 
34
37
  } // namespace g1lf_detail
35
38
  using namespace g1lf_detail;
@@ -39,6 +42,54 @@ using namespace g1lf_detail;
39
42
 
40
43
  /* ---------------------------------------------------------------------- */
41
44
 
45
+ // FC width no / radial width nr (nlm harmonics) runs on the compiled kernels
46
+ inline bool g1lf_fc_ok(int no) { return no == G1LF_NO || no == G1LF_NO_M; }
47
+ inline bool g1lf_radial_ok(int nr, int nlm)
48
+ {
49
+ return nr <= G1LF_NRMAX && G1LF_TEAM % nr == 0 && nr * nlm <= G1LF_TEAM * G1LF_MAX_ACC;
50
+ }
51
+
52
+ template<class DeviceType, class Traits>
53
+ std::array<int, 2> Grace1LFusedKK<DeviceType, Traits>::pad_widths(const GRACE1LModel &m)
54
+ {
55
+ const int nlm = (m.lmax + 1) * (m.lmax + 1), fc = m.fc_A1.n_out;
56
+ if (m.has_uq || m.lmax > G1LF_MAX_LMAX || m.rho_n_out > 4 * G1LF_RQ ||
57
+ (g1lf_radial_ok(m.nradmax, nlm) && g1lf_fc_ok(fc)))
58
+ return {0, 0};
59
+ // radial and FC widths padded to the compiled FC widths 32 / 64
60
+ int nr = g1lf_radial_ok(m.nradmax, nlm) ? m.nradmax : m.nradmax <= G1LF_NO_M ? G1LF_NO_M : G1LF_NO;
61
+ int no = fc <= G1LF_NO_M ? G1LF_NO_M : G1LF_NO;
62
+ if (m.AAA_right_A) nr = no = std::max(nr, no); // legacy AAA = AA1 x A: one channel count
63
+ if (m.nradmax > nr || fc > no || !g1lf_radial_ok(nr, nlm)) return {0, 0};
64
+ return {nr, no};
65
+ }
66
+
67
+ template<class DeviceType, class Traits>
68
+ std::shared_ptr<GRACE1LModel> Grace1LFusedKK<DeviceType, Traits>::padded_model(std::shared_ptr<GRACE1LModel> model)
69
+ {
70
+ const std::array<int, 2> w = model ? pad_widths(*model) : std::array<int, 2>{0, 0};
71
+ return w[0] ? std::make_shared<GRACE1LModel>(model->padded(w[0], w[1])) : model;
72
+ }
73
+
74
+ template<class DeviceType, class Traits>
75
+ std::string Grace1LFusedKK<DeviceType, Traits>::slow_notice(const GRACE1LModel &m)
76
+ {
77
+ const std::array<int, 2> w = pad_widths(m);
78
+ if (!w[0]) return "";
79
+ return fmt("this GRACE-1L model (lmax {}, radial channels {}, FC width {}) has no GPU kernels of its own widths: it "
80
+ "runs zero-padded to {} / {} (the same results, at the cost of the wider model). {}", m.lmax, m.nradmax,
81
+ m.fc_A1.n_out, w[0], w[1], GRACE_KK_ISSUE);
82
+ }
83
+
84
+ template<class DeviceType, class Traits>
85
+ void Grace1LFusedKK<DeviceType, Traits>::set_model(std::shared_ptr<GRACE1LModel> model,
86
+ const std::vector<int> &type2mu)
87
+ {
88
+ auto p = padded_model(model);
89
+ if (p != model) this->log.warn("GRACE-1L/KK: " + slow_notice(*model));
90
+ Base::set_model(std::move(p), type2mu);
91
+ }
92
+
42
93
  template<class DeviceType, class Traits>
43
94
  void Grace1LFusedKK<DeviceType, Traits>::setup()
44
95
  {
@@ -55,22 +106,20 @@ void Grace1LFusedKK<DeviceType, Traits>::setup()
55
106
  const int nlm = (this->lmax + 1) * (this->lmax + 1);
56
107
  if (this->lmax > G1LF_MAX_LMAX)
57
108
  GRACE_KK_ERROR("GRACE-1L/KK: lmax {} > {} not supported", this->lmax, G1LF_MAX_LMAX);
58
- if (this->nradmax * nlm > G1LF_TEAM * G1LF_MAX_ACC || this->nradmax > G1LF_TEAM || G1LF_TEAM % this->nradmax)
109
+ if (!g1lf_radial_ok(this->nradmax, nlm))
59
110
  GRACE_KK_ERROR("GRACE-1L/KK: radial width {} outside the compiled bond kernels", this->nradmax);
60
- if (this->fc_n_out != G1LF_NO && this->fc_n_out != G1LF_NO_M)
111
+ if (!g1lf_fc_ok(this->fc_n_out))
61
112
  GRACE_KK_ERROR("GRACE-1L/KK: FC width {} not compiled (must be {} or {})", this->fc_n_out, G1LF_NO,
62
113
  G1LF_NO_M);
63
- if (this->rho_n_out != 17) GRACE_KK_ERROR("GRACE-1L/KK: rho width must be 17");
64
- if (this->nradmax > G1LF_NIN || this->nradmax > G1LF_NIR)
65
- GRACE_KK_ERROR("GRACE-1L/KK: nradmax {} > {}", this->nradmax, G1LF_NIR);
114
+ if (this->rho_n_out > 4 * G1LF_RQ) GRACE_KK_ERROR("GRACE-1L/KK: rho width {} > {}", this->rho_n_out, 4 * G1LF_RQ);
66
115
  auto live = [](const GRACE1LModel::CGProduct &p, bool left, bool right) {
67
116
  std::vector<int> v;
68
117
  if (left) v.insert(v.end(), p.left_ind.begin(), p.left_ind.end());
69
118
  if (right) v.insert(v.end(), p.right_ind.begin(), p.right_ind.end());
70
119
  return v;
71
120
  };
72
- // A1 feeds AA (both operands) and AAA (right operand)
73
- std::vector<int> liveA1 = live(m.prod_AA, true, true), r = live(m.prod_AAA, false, true);
121
+ // A1 feeds AA (both operands) and AAA (right operand; legacy models: A)
122
+ std::vector<int> liveA1 = live(m.prod_AA, true, true), r = live(m.prod_AAA, false, !m.AAA_right_A);
74
123
  liveA1.insert(liveA1.end(), r.begin(), r.end());
75
124
  build_fc_meta(fcm_A1, m.fc_A1, liveA1);
76
125
  build_fc_meta(fcm_AA1, m.fc_AA1, live(m.prod_AAA, true, false));
@@ -124,7 +173,7 @@ void Grace1LFusedKK<DeviceType, Traits>::build_spline_tables()
124
173
  std::vector<double> g, dg, out, dout;
125
174
  for (int k = 0; k <= N; k++) {
126
175
  radial_basis_x(k * h, p, nrb, g, dg);
127
- mlp_x(layers, g, dg, out, dout);
176
+ mlp_x(layers, g, dg, out, dout, m.radial_activation);
128
177
  for (int o = 0; o < nout; o++) { fv[(size_t) k * nout + o] = out[o]; dv[(size_t) k * nout + o] = h * dout[o]; }
129
178
  }
130
179
  d_splR = V3<F>("g1lf:R", N, nout, 4);
@@ -590,7 +639,7 @@ void Grace1LFusedKK<DeviceType, Traits>::build_red_meta()
590
639
  const GRACE1LModel &m = *this->grace_model;
591
640
  const GRACE1LModel::ReduceWeights *rws[4] = {&m.reduce_A, &m.reduce_AA, &m.reduce_AAA, &m.reduce_AAAA};
592
641
  const int nfi[4] = {(this->lmax + 1) * (this->lmax + 1), this->n_funcs_AA, this->n_funcs_AAA, this->n_funcs_AAAA};
593
- const int ntypes = ((int) this->h_type2model.size() - 1), no = this->rho_n_out, nop = (no + 3) / 4 * 4;
642
+ const int ntypes = ((int) this->h_type2model.size() - 1), no = this->rho_n_out, nop = 4 * G1LF_RQ;
594
643
  rm.nx = 4;
595
644
  int gtot = 0;
596
645
  std::vector<std::array<int, 3>> conns; // (x, fi, tile), sorted by x
@@ -808,8 +857,9 @@ void Grace1LFusedKK<DeviceType, Traits>::stage_dense_fwd()
808
857
  else prod_fwd(pm_AA, this->d_A1, this->d_A1, this->d_AA);
809
858
  if (this->fc_n_out == G1LF_NO) fc_fwd4<G1LF_NO>(fcm_AA1, this->d_AA, this->d_A, this->d_AA1);
810
859
  else fc_fwd4<G1LF_NO_M>(fcm_AA1, this->d_AA, this->d_A, this->d_AA1);
811
- if (shape_id) G1LF_SHAPE_FWD(AAA, this->d_AA1, this->d_A1, this->d_AAA)
812
- else prod_fwd(pm_AAA, this->d_AA1, this->d_A1, this->d_AAA);
860
+ const auto &right = this->grace_model->AAA_right_A ? this->d_A : this->d_A1; // AAA = AA1 x A1 (legacy: x A)
861
+ if (shape_id) G1LF_SHAPE_FWD(AAA, this->d_AA1, right, this->d_AAA)
862
+ else prod_fwd(pm_AAA, this->d_AA1, right, this->d_AAA);
813
863
  if (this->fc_n_out == G1LF_NO) fc_fwd4<G1LF_NO>(fcm_AA2, this->d_AA, this->d_A, this->d_AA2);
814
864
  else fc_fwd4<G1LF_NO_M>(fcm_AA2, this->d_AA, this->d_A, this->d_AA2);
815
865
  if (shape_id) G1LF_SHAPE_FWD(AAAA, this->d_AA2, this->d_AA2, this->d_AAAA)
@@ -817,7 +867,7 @@ void Grace1LFusedKK<DeviceType, Traits>::stage_dense_fwd()
817
867
  }
818
868
 
819
869
  template<class DeviceType, class Traits>
820
- void Grace1LFusedKK<DeviceType, Traits>::stage_reduce() { red_fwd<5>(); }
870
+ void Grace1LFusedKK<DeviceType, Traits>::stage_reduce() { red_fwd<G1LF_RQ>(); }
821
871
 
822
872
  // the reverse reduce assigns A_adj .. AAAA_adj; A1_adj receives AAA (right) before AA (left, accumulated)
823
873
  template<class DeviceType, class Traits>
@@ -826,14 +876,16 @@ void Grace1LFusedKK<DeviceType, Traits>::stage_zero_adj() { Kokkos::deep_copy(th
826
876
  template<class DeviceType, class Traits>
827
877
  void Grace1LFusedKK<DeviceType, Traits>::stage_dense_bwd()
828
878
  {
829
- red_bwd<5, G1LF_NIN>();
879
+ red_bwd<G1LF_RQ, G1LF_NIN>();
830
880
  if (shape_id) G1LF_SHAPE_REV(AAAA, this->d_AA2, this->d_AA2, this->d_AAAA_adj, this->d_AA2_adj, this->d_AA2_adj,
831
881
  (int) this->d_AA2_adj.extent(2))
832
882
  else prod_rev(pm_AAAA, this->d_AA2, this->d_AA2, this->d_AAAA_adj, this->d_AA2_adj, this->d_AA2_adj, false);
833
883
  if (this->fc_n_out == G1LF_NO) fc_bwd<G1LF_NO, G1LF_NIR>(fcm_AA2, this->d_AA2_adj, this->d_AA_adj, this->d_A_adj);
834
884
  else fc_bwd<G1LF_NO_M, G1LF_NIR>(fcm_AA2, this->d_AA2_adj, this->d_AA_adj, this->d_A_adj);
835
- if (shape_id) G1LF_SHAPE_REV(AAA, this->d_AA1, this->d_A1, this->d_AAA_adj, this->d_AA1_adj, this->d_A1_adj, ng_AAA)
836
- else prod_rev(pm_AAA, this->d_AA1, this->d_A1, this->d_AAA_adj, this->d_AA1_adj, this->d_A1_adj, false);
885
+ const bool aaa_a = this->grace_model->AAA_right_A;
886
+ const auto &right = aaa_a ? this->d_A : this->d_A1, &right_adj = aaa_a ? this->d_A_adj : this->d_A1_adj;
887
+ if (shape_id) G1LF_SHAPE_REV(AAA, this->d_AA1, right, this->d_AAA_adj, this->d_AA1_adj, right_adj, ng_AAA)
888
+ else prod_rev(pm_AAA, this->d_AA1, right, this->d_AAA_adj, this->d_AA1_adj, right_adj, false);
837
889
  if (this->fc_n_out == G1LF_NO) fc_bwd<G1LF_NO, G1LF_NIR>(fcm_AA1, this->d_AA1_adj, this->d_AA_adj, this->d_A_adj);
838
890
  else fc_bwd<G1LF_NO_M, G1LF_NIR>(fcm_AA1, this->d_AA1_adj, this->d_AA_adj, this->d_A_adj);
839
891
  // AA reverse accumulates into A1_adj (generated with --acc AA); nothing to zero beyond the generated range
@@ -25,7 +25,7 @@ namespace kk {
25
25
 
26
26
  // Compile-time max dimensions for stack arrays in CUDA kernels
27
27
  static constexpr int GRACE1L_MAX_MLP_DIM = 64; // max hidden dim for MLP layers
28
- static constexpr int GRACE1L_MAX_NRADMAX = 32; // max radial basis functions
28
+ static constexpr int GRACE1L_MAX_NRADMAX = 64; // max radial basis functions
29
29
  static constexpr int GRACE1L_MAX_MLP_LAYERS = 8; // max MLP depth
30
30
  static constexpr int GRACE1L_UQ_MAX_RP_DIM = 132; // bounds the FULL UQ feature dim D = rp_dim + n_density (z/f/delta stack arrays); 132 = 128 rp_dim + up to 3 density channels + 1 slack; a larger model fails the D > MAX guard at load
31
31
 
@@ -71,7 +71,7 @@ class Grace1LKK {
71
71
 
72
72
  // ---- engine API (the LAMMPS glue and the Python module call these) ----
73
73
  // model: loaded GRACE-1L model; type2mu[t] (t = 1..ntypes): model element of atom type t, -1 unmapped
74
- void set_model(std::shared_ptr<GRACE1LModel> model, const std::vector<int> &type2mu);
74
+ virtual void set_model(std::shared_ptr<GRACE1LModel> model, const std::vector<int> &type2mu);
75
75
  virtual void setup(); // scalars, harmonics, device weights (LAMMPS: init_style)
76
76
  // another species set on a set-up engine: only the type tables (atom type -> model element, pair cutoffs and the
77
77
  // fused engines' per-type packed weights) are rebuilt; weights, spline tables and buffers stay
@@ -421,6 +421,7 @@ class Grace1LKK {
421
421
  int energy_n_layers;
422
422
  int energy_max_dim;
423
423
  int energy_activation; // 0=silu, 1=tanh (device-side mirror)
424
+ bool energy_ln = false; // legacy models: RMS layer norm of the MLP input (scale folded into layer 0)
424
425
 
425
426
  // Per-element shifts
426
427
  t_nn_1d d_shifts; // [n_elements]
@@ -430,6 +430,7 @@ void Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::copy_weights_to_devi
430
430
  GRACE_KK_ERROR("GRACE-1L/KK: energy_mlp_activation={} not supported "
431
431
  "(only 0=silu, 1=tanh)", m.energy_mlp_activation);
432
432
  energy_activation = m.energy_mlp_activation;
433
+ energy_ln = m.energy_mlp_ln;
433
434
  int emax_in = 0, emax_out = 0;
434
435
  for (int i = 0; i < energy_n_layers; i++) {
435
436
  if (m.energy_mlp_layers[i].n_in > emax_in) emax_in = m.energy_mlp_layers[i].n_in;
@@ -1898,6 +1899,10 @@ void Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::operator() (TagCompu
1898
1899
  const int nin0 = d_energy_dims(0);
1899
1900
  for (int k = 0; k < nin0; k++)
1900
1901
  h_cur[k] = d_rho(ii, k + 1);
1902
+ if (energy_ln) { // legacy models: RMS layer norm of the MLP input
1903
+ const NNScalar q = inv_rms<NNScalar>([&](int k) { return h_cur[k]; }, nin0);
1904
+ for (int k = 0; k < nin0; k++) h_cur[k] *= q;
1905
+ }
1901
1906
 
1902
1907
  // Hidden layers: 0 .. energy_n_layers-2 (silu or tanh activation)
1903
1908
  for (int layer = 0; layer < energy_n_layers - 1; layer++) {
@@ -2780,6 +2785,9 @@ double Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::cutoff(int mu_i, i
2780
2785
  template<class DeviceType, typename NNScalarT, typename GeomScalarT, class Traits>
2781
2786
  void Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::setup()
2782
2787
  {
2788
+ // the base stages evaluate the radial MLP with silu and AAA = AA1 x A1: legacy models run in the fused engine only
2789
+ if (need_bond_buffers() && (grace_model->radial_activation || grace_model->AAA_right_A))
2790
+ GRACE_KK_ERROR("GRACE-1L/KK: legacy GRACE-1L model: the fused engine only");
2783
2791
  // Copy scalar architecture params
2784
2792
  nelements = grace_model->n_elements;
2785
2793
  lmax = grace_model->lmax;
@@ -2998,8 +3006,12 @@ Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::run(const RunInput &in)
2998
3006
  int cs = chunk_size;
2999
3007
  int eact = energy_activation;
3000
3008
  const NNScalar os = output_scale;
3009
+ const bool ln = energy_ln;
3001
3010
  Kokkos::parallel_for("ReverseMLPEnergy", Kokkos::RangePolicy<DeviceType>(0, cs),
3002
3011
  KOKKOS_LAMBDA(const int ii) {
3012
+ // legacy models: RMS layer norm z = x q of the MLP input x = rho[1:]
3013
+ auto x = [&](int k) { return rho_in(ii, k + 1); };
3014
+ const NNScalar q = ln ? inv_rms<NNScalar>(x, edims(0)) : NNScalar(1);
3003
3015
  // Stack arrays: pre_act for hidden layers, adj ping-pong
3004
3016
  NNScalar pre_act_buf[GRACE1L_MAX_MLP_LAYERS * GRACE1L_MAX_MLP_DIM];
3005
3017
  NNScalar adj_a[GRACE1L_MAX_MLP_DIM], adj_b[GRACE1L_MAX_MLP_DIM];
@@ -3019,7 +3031,7 @@ Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::run(const RunInput &in)
3019
3031
  NNScalar sum = 0.0;
3020
3032
  for (int k = 0; k < nin; k++)
3021
3033
  sum += eW(0, k, j) * rho_in(ii, k + 1);
3022
- pre_act[0 * emax + j] = sum * enorms(0);
3034
+ pre_act[0 * emax + j] = (ln ? sum * q : sum) * enorms(0);
3023
3035
  }
3024
3036
  }
3025
3037
  // Hidden layers 1..en_layers-2: pre_act[layer] = norm * W @ act(pre_act[layer-1])
@@ -3088,8 +3100,9 @@ Grace1LKK<DeviceType, NNScalarT, GeomScalarT, Traits>::run(const RunInput &in)
3088
3100
  // Swap for next iteration
3089
3101
  NNScalar* tmp = adj_cur; adj_cur = adj_nxt; adj_nxt = tmp;
3090
3102
  }
3091
- // adj_cur now holds d_output/d_rho[k+1] for k=0..edims(0)-1
3103
+ // adj_cur now holds d_output/d_rho[k+1] for k=0..edims(0)-1 (legacy models: after the layer norm)
3092
3104
  const int nin0 = edims(0);
3105
+ if (ln) ln_bwd([&](int k) -> NNScalar & { return adj_cur[k]; }, x, nin0, q);
3093
3106
  for (int k = 0; k < nin0; k++)
3094
3107
  rho_adj(ii, k + 1) = adj_cur[k];
3095
3108
  });