grace-runtime 0.0.0.dev0__tar.gz → 0.1.1__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/.github/workflows/cpu-wheels.yml +112 -0
  2. grace_runtime-0.1.1/.github/workflows/cuda-wheels.yml +97 -0
  3. grace_runtime-0.1.1/.github/workflows/release.yml +88 -0
  4. grace_runtime-0.1.1/.github/workflows/rocm-wheels.yml +112 -0
  5. grace_runtime-0.1.1/.gitignore +13 -0
  6. grace_runtime-0.1.1/.readthedocs.yaml +16 -0
  7. grace_runtime-0.1.1/CHANGELOG.md +187 -0
  8. grace_runtime-0.1.1/CMakeLists.txt +132 -0
  9. grace_runtime-0.1.1/LICENSE.md +93 -0
  10. grace_runtime-0.1.1/PKG-INFO +110 -0
  11. grace_runtime-0.1.1/README.md +87 -0
  12. grace_runtime-0.1.1/THIRD_PARTY_NOTICES.md +72 -0
  13. grace_runtime-0.1.1/cmake/GraceHipAtomics.cmake +40 -0
  14. grace_runtime-0.1.1/cmake/GraceRuntime.cmake +31 -0
  15. grace_runtime-0.1.1/docs/advanced.md +86 -0
  16. grace_runtime-0.1.1/docs/api.md +174 -0
  17. grace_runtime-0.1.1/docs/backends.md +91 -0
  18. grace_runtime-0.1.1/docs/benchmarks.md +22 -0
  19. grace_runtime-0.1.1/docs/development.md +96 -0
  20. grace_runtime-0.1.1/docs/dispersion.md +85 -0
  21. grace_runtime-0.1.1/docs/hooks/api_reference.py +69 -0
  22. grace_runtime-0.1.1/docs/images/benchmarks-cpu-dark.png +0 -0
  23. grace_runtime-0.1.1/docs/images/benchmarks-cpu-light.png +0 -0
  24. grace_runtime-0.1.1/docs/images/benchmarks-gpu-dark.png +0 -0
  25. grace_runtime-0.1.1/docs/images/benchmarks-gpu-light.png +0 -0
  26. grace_runtime-0.1.1/docs/index.md +62 -0
  27. grace_runtime-0.1.1/docs/installation.md +105 -0
  28. grace_runtime-0.1.1/docs/lammps.md +257 -0
  29. grace_runtime-0.1.1/docs/models.md +65 -0
  30. grace_runtime-0.1.1/docs/pace.md +138 -0
  31. grace_runtime-0.1.1/docs/properties.md +88 -0
  32. grace_runtime-0.1.1/docs/relax.md +72 -0
  33. grace_runtime-0.1.1/docs/requirements.txt +2 -0
  34. grace_runtime-0.1.1/docs/torchsim.md +40 -0
  35. grace_runtime-0.1.1/docs/usage.md +126 -0
  36. grace_runtime-0.1.1/libgrace/include/grace/bonds.h +164 -0
  37. grace_runtime-0.1.1/libgrace/include/grace/cell_list.h +256 -0
  38. grace_runtime-0.1.1/libgrace/include/grace/coupling.h +54 -0
  39. grace_runtime-0.1.1/libgrace/include/grace/cpu_gemm.h +223 -0
  40. grace_runtime-0.1.1/libgrace/include/grace/cpu_simd.h +203 -0
  41. grace_runtime-0.1.1/libgrace/include/grace/d3.h +622 -0
  42. grace_runtime-0.1.1/libgrace/include/grace/d3_params.h +8409 -0
  43. grace_runtime-0.1.1/libgrace/include/grace/dispersion.h +68 -0
  44. grace_runtime-0.1.1/libgrace/include/grace/error.h +16 -0
  45. grace_runtime-0.1.1/libgrace/include/grace/fused_1l.h +101 -0
  46. grace_runtime-0.1.1/libgrace/include/grace/fused_2l.h +162 -0
  47. grace_runtime-0.1.1/libgrace/include/grace/fused_3l.h +81 -0
  48. grace_runtime-0.1.1/libgrace/include/grace/fused_3l_cpu.h +545 -0
  49. grace_runtime-0.1.1/libgrace/include/grace/fused_cpu.h +1453 -0
  50. grace_runtime-0.1.1/libgrace/include/grace/fused_cpu_types.h +190 -0
  51. grace_runtime-0.1.1/libgrace/include/grace/hd.h +11 -0
  52. grace_runtime-0.1.1/libgrace/include/grace/kk/blas.h +280 -0
  53. grace_runtime-0.1.1/libgrace/include/grace/kk/csr_images.h +366 -0
  54. grace_runtime-0.1.1/libgrace/include/grace/kk/cublas_guard.h +111 -0
  55. grace_runtime-0.1.1/libgrace/include/grace/kk/d3_kk.h +626 -0
  56. grace_runtime-0.1.1/libgrace/include/grace/kk/fused_common.h +235 -0
  57. grace_runtime-0.1.1/libgrace/include/grace/kk/fused_dense.h +649 -0
  58. grace_runtime-0.1.1/libgrace/include/grace/kk/fused_hip_bonds.h +427 -0
  59. grace_runtime-0.1.1/libgrace/include/grace/kk/g1l_shape_large.h +3954 -0
  60. grace_runtime-0.1.1/libgrace/include/grace/kk/g2l_shape_smaxl.h +20295 -0
  61. grace_runtime-0.1.1/libgrace/include/grace/kk/g2l_shape_smaxm.h +12389 -0
  62. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_1l_fused_kk.h +111 -0
  63. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_1l_fused_kk_impl.h +856 -0
  64. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_1l_kk.h +592 -0
  65. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_1l_kk_impl.h +3139 -0
  66. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_2l_fused_kk.h +223 -0
  67. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_2l_fused_kk_impl.h +2457 -0
  68. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_2l_kk.h +942 -0
  69. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_2l_kk_impl.h +5579 -0
  70. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_fused_kk.h +28 -0
  71. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk.h +1485 -0
  72. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_cpl.h +880 -0
  73. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_cpl_path.h +248 -0
  74. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_dense.h +1221 -0
  75. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_impl.h +4244 -0
  76. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_radial.h +833 -0
  77. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_spbf.h +2057 -0
  78. grace_runtime-0.1.1/libgrace/include/grace/kk/grace_3l_kk_spbf_mfma.h +689 -0
  79. grace_runtime-0.1.1/libgrace/include/grace/kk/kk_gemm.h +398 -0
  80. grace_runtime-0.1.1/libgrace/include/grace/kk/kk_mfma.h +198 -0
  81. grace_runtime-0.1.1/libgrace/include/grace/kk/neighbors_kk.h +684 -0
  82. grace_runtime-0.1.1/libgrace/include/grace/kk/pace_kk.h +1201 -0
  83. grace_runtime-0.1.1/libgrace/include/grace/kk/rocblas_guard.h +78 -0
  84. grace_runtime-0.1.1/libgrace/include/grace/kk/support.h +500 -0
  85. grace_runtime-0.1.1/libgrace/include/grace/kk/traits.h +55 -0
  86. grace_runtime-0.1.1/libgrace/include/grace/model_1l.h +137 -0
  87. grace_runtime-0.1.1/libgrace/include/grace/model_2l.h +197 -0
  88. grace_runtime-0.1.1/libgrace/include/grace/model_3l.h +192 -0
  89. grace_runtime-0.1.1/libgrace/include/grace/model_kind.h +25 -0
  90. grace_runtime-0.1.1/libgrace/include/grace/pace_cpu.h +51 -0
  91. grace_runtime-0.1.1/libgrace/include/grace/pace_embedding.h +110 -0
  92. grace_runtime-0.1.1/libgrace/include/grace/pace_model.h +70 -0
  93. grace_runtime-0.1.1/libgrace/include/grace/pace_radial.h +371 -0
  94. grace_runtime-0.1.1/libgrace/include/grace/pace_tables.h +57 -0
  95. grace_runtime-0.1.1/libgrace/include/grace/system.h +123 -0
  96. grace_runtime-0.1.1/libgrace/include/grace/type_map.h +36 -0
  97. grace_runtime-0.1.1/libgrace/include/grace/uq.h +56 -0
  98. grace_runtime-0.1.1/libgrace/include/grace/uq_head.h +34 -0
  99. grace_runtime-0.1.1/libgrace/src/fused_1l.cpp +633 -0
  100. grace_runtime-0.1.1/libgrace/src/fused_2l.cpp +1182 -0
  101. grace_runtime-0.1.1/libgrace/src/fused_3l.cpp +1644 -0
  102. grace_runtime-0.1.1/libgrace/src/model_1l.cpp +290 -0
  103. grace_runtime-0.1.1/libgrace/src/model_2l.cpp +478 -0
  104. grace_runtime-0.1.1/libgrace/src/model_3l.cpp +464 -0
  105. grace_runtime-0.1.1/libgrace/src/model_kind.cpp +139 -0
  106. grace_runtime-0.1.1/libgrace/src/npz3.h +406 -0
  107. grace_runtime-0.1.1/libgrace/src/pace_convert.cpp +1078 -0
  108. grace_runtime-0.1.1/libgrace/src/pace_convert.h +48 -0
  109. grace_runtime-0.1.1/libgrace/src/pace_cpu.cpp +678 -0
  110. grace_runtime-0.1.1/libgrace/src/pace_model.cpp +159 -0
  111. grace_runtime-0.1.1/libgrace/src/pace_tables.cpp +95 -0
  112. grace_runtime-0.1.1/libgrace/src/pace_yaml.cpp +355 -0
  113. grace_runtime-0.1.1/libgrace/src/pace_yaml.h +38 -0
  114. grace_runtime-0.1.1/libgrace/src/uq.cpp +31 -0
  115. grace_runtime-0.1.1/libgrace/src/uq_head.cpp +92 -0
  116. grace_runtime-0.1.1/libgrace/third_party/d3_data/LICENSE +202 -0
  117. grace_runtime-0.1.1/libgrace/third_party/grace_cnpy/LICENSE +21 -0
  118. grace_runtime-0.1.1/libgrace/third_party/grace_cnpy/cnpy.cpp +381 -0
  119. grace_runtime-0.1.1/libgrace/third_party/grace_cnpy/cnpy.h +284 -0
  120. grace_runtime-0.1.1/mkdocs.yml +78 -0
  121. grace_runtime-0.1.1/pyproject.toml +36 -0
  122. grace_runtime-0.1.1/python/CMakeLists.txt +100 -0
  123. grace_runtime-0.1.1/python/LICENSE-libomp +361 -0
  124. grace_runtime-0.1.1/python/examples/ase/grace_runtime_ase.ipynb +799 -0
  125. grace_runtime-0.1.1/python/examples/phonons/phonons_batch.py +51 -0
  126. grace_runtime-0.1.1/python/examples/relax/solute_vacancy_relax.py +78 -0
  127. grace_runtime-0.1.1/python/examples/torchsim/_models.py +10 -0
  128. grace_runtime-0.1.1/python/examples/torchsim/elastic_batch.py +112 -0
  129. grace_runtime-0.1.1/python/examples/torchsim/solute_vacancy_relax.py +118 -0
  130. grace_runtime-0.1.1/python/examples/torchsim/temperature_scan.py +110 -0
  131. grace_runtime-0.1.1/python/examples/torchsim/uq_md_ensemble.py +161 -0
  132. grace_runtime-0.1.1/python/grace_runtime/__init__.py +20 -0
  133. grace_runtime-0.1.1/python/grace_runtime/_core.py +35 -0
  134. grace_runtime-0.1.1/python/grace_runtime/_cuda.py +299 -0
  135. grace_runtime-0.1.1/python/grace_runtime/_dispatch.py +71 -0
  136. grace_runtime-0.1.1/python/grace_runtime/_gpu.py +184 -0
  137. grace_runtime-0.1.1/python/grace_runtime/_rocm.py +256 -0
  138. grace_runtime-0.1.1/python/grace_runtime/batch.py +225 -0
  139. grace_runtime-0.1.1/python/grace_runtime/calculator.py +386 -0
  140. grace_runtime-0.1.1/python/grace_runtime/cli.py +221 -0
  141. grace_runtime-0.1.1/python/grace_runtime/dispersion.py +104 -0
  142. grace_runtime-0.1.1/python/grace_runtime/models.json +220 -0
  143. grace_runtime-0.1.1/python/grace_runtime/neighbors.py +96 -0
  144. grace_runtime-0.1.1/python/grace_runtime/phonons.py +89 -0
  145. grace_runtime-0.1.1/python/grace_runtime/properties.py +252 -0
  146. grace_runtime-0.1.1/python/grace_runtime/registry.py +160 -0
  147. grace_runtime-0.1.1/python/grace_runtime/relax.py +693 -0
  148. grace_runtime-0.1.1/python/grace_runtime/torchsim.py +297 -0
  149. grace_runtime-0.1.1/python/kk/CMakeLists.txt +116 -0
  150. grace_runtime-0.1.1/python/kk/kk_api.h +156 -0
  151. grace_runtime-0.1.1/python/kk/kk_core.cpp +1501 -0
  152. grace_runtime-0.1.1/python/kk/kk_core_3l.cpp +8 -0
  153. grace_runtime-0.1.1/python/kk/kk_module.cpp +273 -0
  154. grace_runtime-0.1.1/python/src/core.cpp +529 -0
  155. grace_runtime-0.1.1/python/src/dispersion_args.h +35 -0
  156. grace_runtime-0.1.1/python/src/exports.map +2 -0
  157. grace_runtime-0.1.1/python/src/neighbors.cpp +97 -0
  158. grace_runtime-0.1.1/python/src/neighbors.h +26 -0
  159. grace_runtime-0.1.1/python/tests/conftest.py +78 -0
  160. grace_runtime-0.1.1/python/tests/d3_ref.py +28 -0
  161. grace_runtime-0.1.1/python/tests/gate_cells.py +72 -0
  162. grace_runtime-0.1.1/python/tests/gpu_tools.py +66 -0
  163. grace_runtime-0.1.1/python/tests/model_tools.py +10 -0
  164. grace_runtime-0.1.1/python/tests/pace_tools.py +91 -0
  165. grace_runtime-0.1.1/python/tests/test_auto_device.py +177 -0
  166. grace_runtime-0.1.1/python/tests/test_batch.py +182 -0
  167. grace_runtime-0.1.1/python/tests/test_bond_source.py +71 -0
  168. grace_runtime-0.1.1/python/tests/test_calculator.py +352 -0
  169. grace_runtime-0.1.1/python/tests/test_compressed.py +77 -0
  170. grace_runtime-0.1.1/python/tests/test_core.py +216 -0
  171. grace_runtime-0.1.1/python/tests/test_cuda_plugin.py +265 -0
  172. grace_runtime-0.1.1/python/tests/test_d3.py +164 -0
  173. grace_runtime-0.1.1/python/tests/test_dispatch.py +107 -0
  174. grace_runtime-0.1.1/python/tests/test_docs_api.py +97 -0
  175. grace_runtime-0.1.1/python/tests/test_energy_only.py +102 -0
  176. grace_runtime-0.1.1/python/tests/test_examples.py +41 -0
  177. grace_runtime-0.1.1/python/tests/test_gpu_alloc_failure.py +179 -0
  178. grace_runtime-0.1.1/python/tests/test_gpu_batch.py +264 -0
  179. grace_runtime-0.1.1/python/tests/test_gpu_batch_device.py +148 -0
  180. grace_runtime-0.1.1/python/tests/test_gpu_calculator.py +235 -0
  181. grace_runtime-0.1.1/python/tests/test_gpu_chunk.py +146 -0
  182. grace_runtime-0.1.1/python/tests/test_gpu_d3.py +164 -0
  183. grace_runtime-0.1.1/python/tests/test_gpu_memory.py +148 -0
  184. grace_runtime-0.1.1/python/tests/test_gpu_module.py +89 -0
  185. grace_runtime-0.1.1/python/tests/test_gpu_pace.py +120 -0
  186. grace_runtime-0.1.1/python/tests/test_gpu_pace_uq.py +49 -0
  187. grace_runtime-0.1.1/python/tests/test_gpu_parity.py +424 -0
  188. grace_runtime-0.1.1/python/tests/test_gpu_properties.py +47 -0
  189. grace_runtime-0.1.1/python/tests/test_gpu_relax.py +91 -0
  190. grace_runtime-0.1.1/python/tests/test_gpu_several_calculators.py +116 -0
  191. grace_runtime-0.1.1/python/tests/test_neighbors.py +199 -0
  192. grace_runtime-0.1.1/python/tests/test_pace.py +165 -0
  193. grace_runtime-0.1.1/python/tests/test_pace_calculator.py +77 -0
  194. grace_runtime-0.1.1/python/tests/test_pace_ctilde.py +55 -0
  195. grace_runtime-0.1.1/python/tests/test_pace_npz.py +28 -0
  196. grace_runtime-0.1.1/python/tests/test_pace_radial.py +44 -0
  197. grace_runtime-0.1.1/python/tests/test_pace_spec.py +168 -0
  198. grace_runtime-0.1.1/python/tests/test_pace_uq.py +71 -0
  199. grace_runtime-0.1.1/python/tests/test_phonons.py +106 -0
  200. grace_runtime-0.1.1/python/tests/test_properties.py +242 -0
  201. grace_runtime-0.1.1/python/tests/test_ref_tf.py +46 -0
  202. grace_runtime-0.1.1/python/tests/test_registry.py +245 -0
  203. grace_runtime-0.1.1/python/tests/test_relax.py +277 -0
  204. grace_runtime-0.1.1/python/tests/test_rocm_plugin.py +397 -0
  205. grace_runtime-0.1.1/python/tests/test_runtimes.py +108 -0
  206. grace_runtime-0.1.1/python/tests/test_symmetry.py +234 -0
  207. grace_runtime-0.1.1/python/tests/test_torchsim.py +321 -0
  208. grace_runtime-0.1.1/python/tests/test_uq.py +134 -0
  209. grace_runtime-0.1.1/python/tests/test_vs_tp.py +93 -0
  210. grace_runtime-0.1.1/python-cuda/CMakeLists.txt +84 -0
  211. grace_runtime-0.1.1/python-cuda/LICENSE-Kokkos +228 -0
  212. grace_runtime-0.1.1/python-cuda/README.md +13 -0
  213. grace_runtime-0.1.1/python-cuda/grace_runtime_cuda12/__init__.py +19 -0
  214. grace_runtime-0.1.1/python-cuda/pyproject.toml +32 -0
  215. grace_runtime-0.1.1/tests/coupling_ref.h +79 -0
  216. grace_runtime-0.1.1/tests/d3_ref.h +98 -0
  217. grace_runtime-0.1.1/tests/fixtures/W2tri.data +19 -0
  218. grace_runtime-0.1.1/tests/fixtures/W2tri.npz +0 -0
  219. grace_runtime-0.1.1/tests/fixtures/W54.data +70 -0
  220. grace_runtime-0.1.1/tests/fixtures/W54.npz +0 -0
  221. grace_runtime-0.1.1/tests/fixtures/WMo54.data +70 -0
  222. grace_runtime-0.1.1/tests/fixtures/WMo54.npz +0 -0
  223. grace_runtime-0.1.1/tests/fixtures/d3_ref.npz +0 -0
  224. grace_runtime-0.1.1/tests/fixtures/pace/al_fs_plain.yaml +90 -0
  225. grace_runtime-0.1.1/tests/fixtures/pace/au_chebpow_density.yaml +158 -0
  226. grace_runtime-0.1.1/tests/fixtures/pace/au_dist_corerep.yaml +158 -0
  227. grace_runtime-0.1.1/tests/fixtures/pace/carbon_zbl.yaml +523 -0
  228. grace_runtime-0.1.1/tests/fixtures/pace/cells.extxyz +496 -0
  229. grace_runtime-0.1.1/tests/fixtures/pace/ethanol_nd1.yaml +513 -0
  230. grace_runtime-0.1.1/tests/fixtures/pace/ho_nd5.yaml +1473 -0
  231. grace_runtime-0.1.1/tests/fixtures/pace/mnbtw_4el.yaml +483 -0
  232. grace_runtime-0.1.1/tests/fixtures/pace/ni_lmax6.yaml +404 -0
  233. grace_runtime-0.1.1/tests/fixtures/pace/pdh_zbl.yaml +395 -0
  234. grace_runtime-0.1.1/tests/fixtures/ref/W2tri_1l.dump +11 -0
  235. grace_runtime-0.1.1/tests/fixtures/ref/W2tri_1l.thermo +1 -0
  236. grace_runtime-0.1.1/tests/fixtures/ref/W2tri_2l.dump +11 -0
  237. grace_runtime-0.1.1/tests/fixtures/ref/W2tri_2l.thermo +1 -0
  238. grace_runtime-0.1.1/tests/fixtures/ref/W2tri_3l.dump +11 -0
  239. grace_runtime-0.1.1/tests/fixtures/ref/W2tri_3l.thermo +1 -0
  240. grace_runtime-0.1.1/tests/fixtures/ref/W54_1l.dump +63 -0
  241. grace_runtime-0.1.1/tests/fixtures/ref/W54_1l.thermo +1 -0
  242. grace_runtime-0.1.1/tests/fixtures/ref/W54_2l.dump +63 -0
  243. grace_runtime-0.1.1/tests/fixtures/ref/W54_2l.thermo +1 -0
  244. grace_runtime-0.1.1/tests/fixtures/ref/W54_3l.dump +63 -0
  245. grace_runtime-0.1.1/tests/fixtures/ref/W54_3l.thermo +1 -0
  246. grace_runtime-0.1.1/tests/fixtures/ref/WMo54_1l.dump +63 -0
  247. grace_runtime-0.1.1/tests/fixtures/ref/WMo54_1l.thermo +1 -0
  248. grace_runtime-0.1.1/tests/fixtures/ref/WMo54_2l.dump +63 -0
  249. grace_runtime-0.1.1/tests/fixtures/ref/WMo54_2l.thermo +1 -0
  250. grace_runtime-0.1.1/tests/fixtures/ref/WMo54_3l.dump +63 -0
  251. grace_runtime-0.1.1/tests/fixtures/ref/WMo54_3l.thermo +1 -0
  252. grace_runtime-0.1.1/tests/fixtures/ref_cpl/WMo54_1l.txt +498 -0
  253. grace_runtime-0.1.1/tests/fixtures/ref_cpl/WMo54_2l.txt +498 -0
  254. grace_runtime-0.1.1/tests/fixtures/ref_cpl/WMo54_3l.txt +498 -0
  255. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_1l_fused.dump +11 -0
  256. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_1l_fused.thermo +1 -0
  257. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_1l_kk.dump +11 -0
  258. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_1l_kk.thermo +1 -0
  259. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_2l_fused.dump +11 -0
  260. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_2l_fused.thermo +1 -0
  261. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_2l_kk.dump +11 -0
  262. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_2l_kk.thermo +1 -0
  263. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_3l_kk.dump +11 -0
  264. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W2tri_3l_kk.thermo +1 -0
  265. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_1l_fused.dump +63 -0
  266. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_1l_fused.thermo +1 -0
  267. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_1l_kk.dump +63 -0
  268. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_1l_kk.thermo +1 -0
  269. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_2l_fused.dump +63 -0
  270. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_2l_fused.thermo +1 -0
  271. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_2l_kk.dump +63 -0
  272. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_2l_kk.thermo +1 -0
  273. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_3l_kk.dump +63 -0
  274. grace_runtime-0.1.1/tests/fixtures/ref_gpu/W54_3l_kk.thermo +1 -0
  275. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_1l_fused.dump +63 -0
  276. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_1l_fused.thermo +1 -0
  277. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_1l_kk.dump +63 -0
  278. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_1l_kk.thermo +1 -0
  279. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_2l_fused.dump +63 -0
  280. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_2l_fused.thermo +1 -0
  281. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_2l_kk.dump +63 -0
  282. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_2l_kk.thermo +1 -0
  283. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_3l_kk.dump +63 -0
  284. grace_runtime-0.1.1/tests/fixtures/ref_gpu/WMo54_3l_kk.thermo +1 -0
  285. grace_runtime-0.1.1/tests/kk/kk_csr_util.h +332 -0
  286. grace_runtime-0.1.1/tests/kk/test_kk_1l_compile.cpp +39 -0
  287. grace_runtime-0.1.1/tests/kk/test_kk_2l_compile.cpp +46 -0
  288. grace_runtime-0.1.1/tests/kk/test_kk_2l_large.cpp +52 -0
  289. grace_runtime-0.1.1/tests/kk/test_kk_3l_compile.cpp +460 -0
  290. grace_runtime-0.1.1/tests/kk/test_kk_coupling.cpp +142 -0
  291. grace_runtime-0.1.1/tests/kk/test_kk_csr.cpp +326 -0
  292. grace_runtime-0.1.1/tests/kk/test_kk_csr_3l.cpp +138 -0
  293. grace_runtime-0.1.1/tests/kk/test_kk_d3.cpp +130 -0
  294. grace_runtime-0.1.1/tests/kk/test_kk_device.cpp +32 -0
  295. grace_runtime-0.1.1/tests/kk/test_kk_gemm.cpp +328 -0
  296. grace_runtime-0.1.1/tests/kk/test_kk_large.cpp +119 -0
  297. grace_runtime-0.1.1/tests/kk/test_kk_launch_check.cpp +53 -0
  298. grace_runtime-0.1.1/tests/kk/test_kk_neighbors.cpp +297 -0
  299. grace_runtime-0.1.1/tests/test_bonds.cpp +109 -0
  300. grace_runtime-0.1.1/tests/test_coupling.cpp +193 -0
  301. grace_runtime-0.1.1/tests/test_d3.cpp +185 -0
  302. grace_runtime-0.1.1/tests/test_driver.cpp +335 -0
  303. grace_runtime-0.1.1/tests/test_driver_uq.cpp +245 -0
  304. grace_runtime-0.1.1/tests/test_error.cpp +20 -0
  305. grace_runtime-0.1.1/tests/test_gemm.cpp +74 -0
  306. grace_runtime-0.1.1/tests/test_host_memory.cpp +94 -0
  307. grace_runtime-0.1.1/tests/test_kernels_compile.cpp +16 -0
  308. grace_runtime-0.1.1/tests/test_model_kind.cpp +101 -0
  309. grace_runtime-0.1.1/tests/test_model_limits.cpp +57 -0
  310. grace_runtime-0.1.1/tests/test_model_load.cpp +126 -0
  311. grace_runtime-0.1.1/tests/test_model_shapes.cpp +141 -0
  312. grace_runtime-0.1.1/tests/test_pace_yaml.cpp +151 -0
  313. grace_runtime-0.1.1/tests/test_uq.cpp +67 -0
  314. grace_runtime-0.1.1/tests/test_util.h +33 -0
  315. grace_runtime-0.0.0.dev0/PKG-INFO +0 -17
  316. grace_runtime-0.0.0.dev0/README.md +0 -6
  317. grace_runtime-0.0.0.dev0/grace_runtime.egg-info/PKG-INFO +0 -17
  318. grace_runtime-0.0.0.dev0/grace_runtime.egg-info/SOURCES.txt +0 -7
  319. grace_runtime-0.0.0.dev0/grace_runtime.egg-info/dependency_links.txt +0 -1
  320. grace_runtime-0.0.0.dev0/grace_runtime.egg-info/top_level.txt +0 -1
  321. grace_runtime-0.0.0.dev0/pyproject.toml +0 -19
  322. grace_runtime-0.0.0.dev0/setup.cfg +0 -4
  323. grace_runtime-0.0.0.dev0/setup.py +0 -8
@@ -0,0 +1,112 @@
1
+ # CPU package grace-runtime: libgrace C++ tests, the sdist and the wheels (CPython 3.10, 3.11 and one abi3 wheel for
2
+ # >= 3.12; scripts/build_wheels.sh, no Docker) for manylinux2014 x86_64 and, on GitHub's ARM runner, macOS arm64, then
3
+ # each wheel in clean environments (scripts/test_wheels.sh). The wheels are kept as the artifacts "cpu-wheels" (x86_64
4
+ # and the sdist) and "cpu-wheels-macos-arm64". Linux aarch64 (scripts/build_wheels.sh can build it) is not released
5
+ # until it has been tested: add {artifact: cpu-wheels-linux-aarch64, os: ubuntu-24.04-arm, mamba: linux-aarch64}.
6
+ name: CPU wheels
7
+
8
+ on:
9
+ workflow_dispatch:
10
+ pull_request:
11
+ branches: [dev] # the release pull request
12
+ paths-ignore: [docs/**, '*.md']
13
+ workflow_call: # from release.yml
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ env:
19
+ TEST_MODELS: "GRACE-2L-SMAX-OMAT-medium GRACE-1L-OMAT-large-base GRACE-2L-OMAT-medium-ft-E GRACE-3L-OMAT-large GRACE-2L-SMAX-OMAT-large"
20
+
21
+ jobs:
22
+ ctest:
23
+ runs-on: ubuntu-latest
24
+ timeout-minutes: 120
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - name: micromamba
28
+ run: |
29
+ mkdir -p ~/.mm && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xj -C ~/.mm bin/micromamba
30
+ echo "MAMBA_EXE=$HOME/.mm/bin/micromamba" >> "$GITHUB_ENV"
31
+ echo "MAMBA_ROOT_PREFIX=$HOME/micromamba" >> "$GITHUB_ENV"
32
+ echo "GRACE_CACHE=$HOME/grace-cache" >> "$GITHUB_ENV"
33
+ - uses: actions/cache@v4
34
+ with:
35
+ path: ~/grace-cache
36
+ key: grace-test-models-v2
37
+ - name: environment and test models
38
+ run: |
39
+ $MAMBA_EXE create -y -q -n gn-ctest -c conda-forge python=3.12 gxx_linux-64 "sysroot_linux-64=2.17" cmake ninja pip numpy ase tqdm
40
+ $MAMBA_ROOT_PREFIX/envs/gn-ctest/bin/python scripts/download_test_models.py $TEST_MODELS
41
+ $MAMBA_ROOT_PREFIX/envs/gn-ctest/bin/python -c "import sys; sys.path.insert(0, 'python/tests'); from model_tools import strip_uq; strip_uq('$GRACE_CACHE/GRACE-2L-SMAX-OMAT-medium/kokkos.npz', 'nouq.npz')"
42
+ - name: build and ctest (x86-64-v3 flags, which every runner CPU runs)
43
+ run: |
44
+ export GRACE_TEST_NOUQ=$PWD/nouq.npz
45
+ $MAMBA_EXE run -n gn-ctest cmake -S . -B build-ci -G Ninja -DCMAKE_BUILD_TYPE=Release "-DGRACE_ARCH_FLAGS=-march=x86-64-v3"
46
+ $MAMBA_EXE run -n gn-ctest cmake --build build-ci -j "$(nproc)"
47
+ cd build-ci && $MAMBA_EXE run -n gn-ctest ctest --output-on-failure
48
+
49
+ wheels:
50
+ strategy:
51
+ fail-fast: false
52
+ matrix:
53
+ platform:
54
+ - {artifact: cpu-wheels, os: ubuntu-latest, mamba: linux-64}
55
+ - {artifact: cpu-wheels-macos-arm64, os: macos-14, mamba: osx-arm64}
56
+ runs-on: ${{ matrix.platform.os }}
57
+ timeout-minutes: 120
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - name: micromamba
61
+ run: |
62
+ mkdir -p ~/.mm && curl -Ls https://micro.mamba.pm/api/micromamba/${{ matrix.platform.mamba }}/latest | tar -xj -C ~/.mm bin/micromamba
63
+ echo "MAMBA_EXE=$HOME/.mm/bin/micromamba" >> "$GITHUB_ENV"
64
+ - name: build
65
+ run: bash scripts/build_wheels.sh dist/wheelhouse
66
+ - name: the sdist from the x86_64 runner only
67
+ if: matrix.platform.artifact != 'cpu-wheels'
68
+ run: rm -f dist/wheelhouse/*.tar.gz
69
+ - uses: actions/upload-artifact@v4
70
+ with:
71
+ name: ${{ matrix.platform.artifact }}
72
+ path: |
73
+ dist/wheelhouse/*.whl
74
+ dist/wheelhouse/*.tar.gz
75
+ if-no-files-found: error
76
+
77
+ test-wheels:
78
+ needs: wheels
79
+ strategy:
80
+ fail-fast: false
81
+ matrix:
82
+ platform:
83
+ - {artifact: cpu-wheels, os: ubuntu-latest, mamba: linux-64}
84
+ - {artifact: cpu-wheels-macos-arm64, os: macos-14, mamba: osx-arm64}
85
+ python: ["3.10", "3.11", "3.12", "3.13"]
86
+ runs-on: ${{ matrix.platform.os }}
87
+ timeout-minutes: 120
88
+ steps:
89
+ - uses: actions/checkout@v4
90
+ - name: micromamba
91
+ run: |
92
+ mkdir -p ~/.mm && curl -Ls https://micro.mamba.pm/api/micromamba/${{ matrix.platform.mamba }}/latest | tar -xj -C ~/.mm bin/micromamba
93
+ echo "MAMBA_EXE=$HOME/.mm/bin/micromamba" >> "$GITHUB_ENV"
94
+ echo "MAMBA_ROOT_PREFIX=$HOME/micromamba" >> "$GITHUB_ENV"
95
+ echo "GRACE_CACHE=$HOME/grace-cache" >> "$GITHUB_ENV"
96
+ - uses: actions/download-artifact@v4
97
+ with:
98
+ name: ${{ matrix.platform.artifact }}
99
+ path: dist/wheelhouse
100
+ - uses: actions/cache@v4
101
+ with:
102
+ path: ~/grace-cache
103
+ key: grace-test-models-v2
104
+ - uses: actions/setup-python@v5
105
+ with:
106
+ python-version: "3.12"
107
+ - name: test models
108
+ run: |
109
+ python -m pip install -q tqdm
110
+ python scripts/download_test_models.py $TEST_MODELS
111
+ - name: test the CPython ${{ matrix.python }} wheel
112
+ run: PYTHONS=${{ matrix.python }} bash scripts/test_wheels.sh dist/wheelhouse
@@ -0,0 +1,97 @@
1
+ # NVIDIA GPU package grace-runtime-cuda12: one job per GPU architecture builds Kokkos (cached) and that architecture's
2
+ # module for CPython 3.10, 3.11 and >= 3.12 (abi3) (scripts/build_cuda_wheels.sh: CUDA 12.9 and conda-forge compilers
3
+ # with the glibc 2.17 sysroot, no Docker, no CUDA toolkit on the runner); scripts/merge_cuda_wheels.py then makes one
4
+ # wheel per CPython tag with all modules. The runners have no GPU: the check job tests the wheels' contents and that
5
+ # device="auto" runs on the CPU without a GPU; the GPU tests are scripts/test_cuda_wheels.sh on a GPU machine.
6
+ # The wheels and the sdist are kept as the artifact "cuda-wheels".
7
+ name: CUDA wheels
8
+
9
+ on:
10
+ workflow_dispatch:
11
+ pull_request:
12
+ branches: [dev] # the release pull request
13
+ paths-ignore: [docs/**, '*.md']
14
+ workflow_call: # from release.yml
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ubuntu-latest
22
+ timeout-minutes: 360
23
+ strategy:
24
+ fail-fast: false
25
+ matrix:
26
+ arch: [sm70, sm80, sm90, sm100, sm120]
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - name: micromamba
30
+ run: |
31
+ mkdir -p ~/.mm && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xj -C ~/.mm bin/micromamba
32
+ echo "MAMBA_EXE=$HOME/.mm/bin/micromamba" >> "$GITHUB_ENV"
33
+ # nvcc needs up to ~3 GB per process
34
+ M=$(free -g | awk '/^Mem:/{print $2}'); echo "NPROC=$(( M / 3 > 0 ? M / 3 : 1 ))" >> "$GITHUB_ENV"
35
+ - uses: actions/cache@v4
36
+ with:
37
+ path: ~/.cache/grace-runtime/kokkos-wheel/install-*-${{ matrix.arch }}
38
+ key: kokkos-${{ matrix.arch }}-${{ hashFiles('python-cuda/CMakeLists.txt', 'scripts/build_cuda_wheels.sh') }}
39
+ - name: build
40
+ run: GRACE_KK_ARCHS=${{ matrix.arch }} bash scripts/build_cuda_wheels.sh dist/cuda-${{ matrix.arch }}
41
+ - uses: actions/upload-artifact@v4
42
+ with:
43
+ name: cuda-${{ matrix.arch }}
44
+ path: |
45
+ dist/cuda-${{ matrix.arch }}/*.whl
46
+ dist/cuda-${{ matrix.arch }}/*.tar.gz
47
+ if-no-files-found: error
48
+
49
+ merge-and-check:
50
+ needs: build
51
+ runs-on: ubuntu-latest
52
+ timeout-minutes: 60
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ - uses: actions/download-artifact@v4
56
+ with:
57
+ pattern: cuda-sm*
58
+ path: dist/parts
59
+ - name: micromamba
60
+ run: |
61
+ mkdir -p ~/.mm && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xj -C ~/.mm bin/micromamba
62
+ echo "MAMBA_EXE=$HOME/.mm/bin/micromamba" >> "$GITHUB_ENV"
63
+ echo "MAMBA_ROOT_PREFIX=$HOME/micromamba" >> "$GITHUB_ENV"
64
+ echo "GRACE_CACHE=$HOME/grace-cache" >> "$GITHUB_ENV"
65
+ - name: merge (one wheel per CPython tag with all modules)
66
+ run: |
67
+ $MAMBA_EXE create -y -q -n gn-cudachk -c conda-forge python=3.12 pip numpy ase tqdm auditwheel binutils
68
+ $MAMBA_ROOT_PREFIX/envs/gn-cudachk/bin/python scripts/merge_cuda_wheels.py dist/cuda-wheelhouse dist/parts/cuda-sm*/*.whl
69
+ cp "$(ls dist/parts/cuda-sm80/*.tar.gz)" dist/cuda-wheelhouse/
70
+ ls -la dist/cuda-wheelhouse
71
+ - name: check the wheels' contents
72
+ run: |
73
+ for w in dist/cuda-wheelhouse/*.whl; do
74
+ $MAMBA_ROOT_PREFIX/envs/gn-cudachk/bin/python scripts/check_cuda_wheel.py "$w" sm70,sm80,sm90,sm100,sm120
75
+ done
76
+ - name: without a GPU, device="auto" runs on the CPU (no warning)
77
+ run: |
78
+ PYTHONS=3.12 bash scripts/build_wheels.sh dist/wheelhouse # the CPU package it plugs into
79
+ P=$MAMBA_ROOT_PREFIX/envs/gn-cudachk/bin
80
+ $P/python -m pip install -q dist/wheelhouse/*cp312-abi3*.whl dist/cuda-wheelhouse/*cp312-abi3*.whl
81
+ $P/grace-runtime models download GRACE-1L-OMAT-large-base
82
+ cd /tmp && $P/python -W error::RuntimeWarning - <<'PY'
83
+ import os, grace_runtime, grace_runtime._cuda as c
84
+ print("plug-ins:", [p.__name__ for p in c.plugins()], "modules:", c.available())
85
+ assert "grace_runtime_cuda12" in [p.__name__ for p in c.plugins()]
86
+ os.environ.pop("GRACE_RUNTIME_DEVICE", None)
87
+ calc = grace_runtime.GRACERuntimeCalculator("GRACE-1L-OMAT-large-base")
88
+ assert calc.backend == "cpu", calc.backend
89
+ print("no GPU: device='auto' ->", calc.backend)
90
+ PY
91
+ - uses: actions/upload-artifact@v4
92
+ with:
93
+ name: cuda-wheels
94
+ path: |
95
+ dist/cuda-wheelhouse/*.whl
96
+ dist/cuda-wheelhouse/*.tar.gz
97
+ if-no-files-found: error
@@ -0,0 +1,88 @@
1
+ # A published GitHub release X.Y.Z builds the packages (the CPU wheels and CUDA wheels workflows) and uploads them by
2
+ # Trusted Publishing. A pre-release goes to TestPyPI (environment "testpypi"), a release to PyPI (environment "pypi");
3
+ # every upload waits for an approval in its environment. grace-runtime goes first and on its own; grace-runtime-cuda12
4
+ # and grace-runtime-rocm6 (which pin grace-runtime==X.Y.Z) are built and follow only when the repository variables
5
+ # GRACE_RELEASE_CUDA / GRACE_RELEASE_ROCM are "true". GRACE_ROCM_ARCHS (a JSON list) overrides the AMD architectures.
6
+ # The files must carry the version of the release tag.
7
+ name: Release
8
+
9
+ on:
10
+ release:
11
+ types: [published]
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ cpu:
18
+ uses: ./.github/workflows/cpu-wheels.yml
19
+
20
+ publish-cpu:
21
+ needs: cpu
22
+ runs-on: ubuntu-latest
23
+ environment: ${{ github.event.release.prerelease && 'testpypi' || 'pypi' }}
24
+ permissions:
25
+ id-token: write
26
+ steps:
27
+ - uses: actions/download-artifact@v4
28
+ with:
29
+ pattern: cpu-wheels* # x86_64 and the sdist, macOS arm64
30
+ merge-multiple: true
31
+ path: dist
32
+ - name: version = release tag
33
+ run: |
34
+ T=${{ github.event.release.tag_name }}; ls dist
35
+ for f in dist/*; do case "$(basename "$f")" in grace_runtime-$T-*.whl|grace_runtime-$T.tar.gz) ;; *) echo "::error::$f is not version $T"; exit 1 ;; esac; done
36
+ - uses: pypa/gh-action-pypi-publish@release/v1
37
+ with:
38
+ repository-url: ${{ github.event.release.prerelease && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
39
+
40
+ cuda:
41
+ if: vars.GRACE_RELEASE_CUDA == 'true'
42
+ uses: ./.github/workflows/cuda-wheels.yml
43
+
44
+ publish-cuda:
45
+ if: vars.GRACE_RELEASE_CUDA == 'true'
46
+ needs: [cuda, publish-cpu]
47
+ runs-on: ubuntu-latest
48
+ environment: ${{ github.event.release.prerelease && 'testpypi' || 'pypi' }}
49
+ permissions:
50
+ id-token: write
51
+ steps:
52
+ - uses: actions/download-artifact@v4
53
+ with:
54
+ name: cuda-wheels
55
+ path: dist
56
+ - name: version = release tag
57
+ run: |
58
+ T=${{ github.event.release.tag_name }}; ls dist
59
+ for f in dist/*; do case "$(basename "$f")" in grace_runtime_cuda12-$T-*.whl|grace_runtime_cuda12-$T.tar.gz) ;; *) echo "::error::$f is not version $T"; exit 1 ;; esac; done
60
+ - uses: pypa/gh-action-pypi-publish@release/v1
61
+ with:
62
+ repository-url: ${{ github.event.release.prerelease && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
63
+
64
+ rocm:
65
+ if: vars.GRACE_RELEASE_ROCM == 'true'
66
+ uses: ./.github/workflows/rocm-wheels.yml
67
+ with:
68
+ archs: ${{ vars.GRACE_ROCM_ARCHS || '["gfx90a","gfx942"]' }}
69
+
70
+ publish-rocm:
71
+ if: vars.GRACE_RELEASE_ROCM == 'true'
72
+ needs: [rocm, publish-cpu]
73
+ runs-on: ubuntu-latest
74
+ environment: ${{ github.event.release.prerelease && 'testpypi' || 'pypi' }}
75
+ permissions:
76
+ id-token: write
77
+ steps:
78
+ - uses: actions/download-artifact@v4
79
+ with:
80
+ name: rocm-wheels
81
+ path: dist
82
+ - name: version = release tag
83
+ run: |
84
+ T=${{ github.event.release.tag_name }}; ls dist
85
+ for f in dist/*; do case "$(basename "$f")" in grace_runtime_rocm6-$T-*.whl|grace_runtime_rocm6-$T.tar.gz) ;; *) echo "::error::$f is not version $T"; exit 1 ;; esac; done
86
+ - uses: pypa/gh-action-pypi-publish@release/v1
87
+ with:
88
+ repository-url: ${{ github.event.release.prerelease && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
@@ -0,0 +1,112 @@
1
+ # AMD GPU package grace-runtime-rocm6, started by hand or from release.yml (not on pull requests).
2
+ # One job per GPU architecture builds Kokkos (cached) and that architecture's module for CPython 3.10, 3.11 and >= 3.12
3
+ # (abi3) in the manylinux_2_28 image (scripts/build_rocm_wheels.sh: the image's g++, ROCm 6.2.4 from AMD's RHEL 8
4
+ # packages, unpacked without root); scripts/merge_cuda_wheels.py then makes one wheel per CPython tag with all modules.
5
+ # The wheels need ROCm 6 on the user's machine (libamdhip64.so.6); they bundle no ROCm library (rocBLAS is loaded at run
6
+ # time when present). The runners have no GPU: the check job tests the wheels' contents and that device="auto" runs on
7
+ # the CPU without a GPU; the GPU tests are scripts/test_rocm_wheels.sh on an AMD GPU machine.
8
+ # The wheels and the sdist are kept as the artifact "rocm-wheels".
9
+ name: ROCm wheels
10
+
11
+ on:
12
+ workflow_dispatch:
13
+ inputs:
14
+ archs:
15
+ description: 'GPU architectures, a JSON list, e.g. ["gfx90a","gfx942","gfx1100","gfx1201"]'
16
+ type: string
17
+ default: '["gfx90a","gfx942"]'
18
+ workflow_call: # from release.yml
19
+ inputs:
20
+ archs:
21
+ type: string
22
+ default: '["gfx90a","gfx942"]'
23
+
24
+ permissions:
25
+ contents: read
26
+
27
+ env:
28
+ IMAGE: quay.io/pypa/manylinux_2_28_x86_64:2026.10.16-1
29
+
30
+ jobs:
31
+ build:
32
+ runs-on: ubuntu-latest
33
+ timeout-minutes: 240
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ arch: ${{ fromJSON(inputs.archs) }}
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: actions/cache@v4
41
+ with:
42
+ path: ~/.cache/grace-runtime/kokkos-rocm-wheel/install-*-${{ matrix.arch }}
43
+ key: kokkos-rocm-${{ matrix.arch }}-${{ env.IMAGE }}-${{ hashFiles('python-rocm6/CMakeLists.txt', 'scripts/build_rocm_wheels.sh') }}
44
+ - name: build (manylinux_2_28 image)
45
+ run: |
46
+ mkdir -p ~/.cache/grace-runtime
47
+ docker run --rm -v "$PWD:/io" -v "$HOME/.cache/grace-runtime:/root/.cache/grace-runtime" -w /io \
48
+ -e GRACE_KK_ARCHS=${{ matrix.arch }} -e NPROC="$(nproc)" "$IMAGE" \
49
+ bash scripts/build_rocm_wheels.sh dist/rocm-${{ matrix.arch }}
50
+ sudo chown -R "$(id -u):$(id -g)" dist ~/.cache/grace-runtime
51
+ - uses: actions/upload-artifact@v4
52
+ with:
53
+ name: rocm-${{ matrix.arch }}
54
+ path: |
55
+ dist/rocm-${{ matrix.arch }}/*.whl
56
+ dist/rocm-${{ matrix.arch }}/*.tar.gz
57
+ if-no-files-found: error
58
+
59
+ merge-and-check:
60
+ needs: build
61
+ runs-on: ubuntu-latest
62
+ timeout-minutes: 60
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ - uses: actions/download-artifact@v4
66
+ with:
67
+ pattern: rocm-gfx*
68
+ path: dist/parts
69
+ - name: micromamba
70
+ run: |
71
+ mkdir -p ~/.mm && curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xj -C ~/.mm bin/micromamba
72
+ { echo "MAMBA_EXE=$HOME/.mm/bin/micromamba"; echo "MAMBA_ROOT_PREFIX=$HOME/micromamba"
73
+ echo "GRACE_CACHE=$HOME/grace-cache"; } >> "$GITHUB_ENV"
74
+ - name: merge (one wheel per CPython tag with all modules)
75
+ run: |
76
+ "$MAMBA_EXE" create -y -q -n gn-rocmchk -c conda-forge python=3.12 pip numpy ase tqdm pytest auditwheel binutils
77
+ "$MAMBA_ROOT_PREFIX/envs/gn-rocmchk/bin/python" scripts/merge_cuda_wheels.py dist/rocm-wheelhouse dist/parts/rocm-gfx*/*.whl
78
+ cp "$(find dist/parts -name '*.tar.gz' | head -1)" dist/rocm-wheelhouse/
79
+ ls -la dist/rocm-wheelhouse
80
+ - name: check the wheels' contents
81
+ run: |
82
+ for w in dist/rocm-wheelhouse/*.whl; do
83
+ "$MAMBA_ROOT_PREFIX/envs/gn-rocmchk/bin/python" scripts/check_rocm_wheel.py "$w" "${{ join(fromJSON(inputs.archs), ',') }}"
84
+ done
85
+ - name: without a GPU, device="auto" runs on the CPU (no warning)
86
+ run: |
87
+ PYTHONS=3.12 bash scripts/build_wheels.sh dist/wheelhouse # the CPU package it plugs into
88
+ P=$MAMBA_ROOT_PREFIX/envs/gn-rocmchk/bin
89
+ "$P/python" -m pip install -q dist/wheelhouse/*cp312-abi3*.whl dist/rocm-wheelhouse/*cp312-abi3*.whl
90
+ "$P/grace-runtime" models download GRACE-1L-OMAT-large-base
91
+ "$P/python" -m pytest -q -p no:cacheprovider python/tests/test_rocm_plugin.py
92
+ cd /tmp && "$P/python" -W error::RuntimeWarning - <<'PY'
93
+ import os, grace_runtime, grace_runtime._rocm as r
94
+ print("plug-ins:", [p.__name__ for p in r.plugins()], "modules:", r.available())
95
+ assert "grace_runtime_rocm6" in [p.__name__ for p in r.plugins()]
96
+ os.environ.pop("GRACE_RUNTIME_DEVICE", None)
97
+ calc = grace_runtime.GRACERuntimeCalculator("GRACE-1L-OMAT-large-base")
98
+ assert calc.backend == "cpu", calc.backend
99
+ print("no GPU: device='auto' ->", calc.backend)
100
+ try:
101
+ grace_runtime.GRACERuntimeCalculator("GRACE-1L-OMAT-large-base", device="rocm")
102
+ raise SystemExit("device='rocm' without a GPU did not fail")
103
+ except ImportError as e:
104
+ print("no GPU: device='rocm' ->", type(e).__name__, e)
105
+ PY
106
+ - uses: actions/upload-artifact@v4
107
+ with:
108
+ name: rocm-wheels
109
+ path: |
110
+ dist/rocm-wheelhouse/*.whl
111
+ dist/rocm-wheelhouse/*.tar.gz
112
+ if-no-files-found: error
@@ -0,0 +1,13 @@
1
+ build*/
2
+ __pycache__/
3
+ *.npz
4
+ !tests/fixtures/*.npz
5
+ Testing/
6
+ python/build/
7
+ *.egg-info/
8
+ *.so
9
+ dist/
10
+ .micromamba/
11
+ .mm/
12
+ .grace-cache/
13
+ .worktrees/
@@ -0,0 +1,16 @@
1
+ # Read the Docs configuration file
2
+ # https://docs.readthedocs.io/en/stable/config-file/v2.html
3
+ version: 2
4
+
5
+ build:
6
+ os: ubuntu-24.04
7
+ tools:
8
+ python: "3.13"
9
+
10
+ mkdocs:
11
+ configuration: mkdocs.yml
12
+ fail_on_warning: true
13
+
14
+ python:
15
+ install:
16
+ - requirements: docs/requirements.txt
@@ -0,0 +1,187 @@
1
+ # Changelog
2
+
3
+ Notable changes of grace-runtime, grace-runtime-cuda12 and grace-runtime-rocm6 (they share one version). Each
4
+ release has a section "Changed defaults" when a default behaves differently.
5
+
6
+ ## [0.1.1](https://github.com/ICAMS/grace-runtime/releases/tag/0.1.1) (2026-10-29)
7
+
8
+ Bug fixes and documentation.
9
+
10
+ ### Fixed
11
+
12
+ - NVIDIA and AMD GPUs: GRACE-1L with 33.5 million atoms (2^25) or more stopped the whole process instead of running.
13
+ It now runs up to the GPU memory (A100 80 GB: 41 million atoms) and beyond that raises the usual "does not fit the
14
+ GPU memory" error.
15
+ - The PyPI page of `grace-runtime` shows the README.
16
+ - macOS: `pip install "grace-runtime[torchsim]"` installed PyTorch from PyPI, whose OpenMP runtime clashes with the
17
+ one of grace-runtime (`OMP: Error #15`). On macOS the extra now installs nothing; install PyTorch from conda-forge
18
+ (see the installation guide).
19
+ - macOS: `grace-runtime info` says that the GPU modules are Linux-only, instead of listing where it looked for the
20
+ NVIDIA driver.
21
+
22
+ ### LAMMPS (`grace-runtime` branch of the LAMMPS fork)
23
+
24
+ - CPU styles: `GRACE_BLAS=AUTO` uses a BLAS only if it is MKL, OpenBLAS, BLIS or Accelerate, otherwise the built-in
25
+ kernel. Other BLAS libraries (for example ATLAS) made GRACE-3L about 4x slower, and on HPE Cray systems the BLAS
26
+ linked by the compiler made the link fail.
27
+ - CMake warns when the CPU styles are built with GCC older than 12: with GCC 11 GRACE-3L runs about 37 % slower,
28
+ with GCC 9 GRACE-1L about 4.6x and GRACE-3L about 6.6x slower.
29
+
30
+ ### Documentation
31
+
32
+ - LAMMPS guide: build the fork for CPU, NVIDIA and AMD GPUs (with an example for LUMI), get a model, and run a first
33
+ input that also prints the extrapolation grade.
34
+ - Windows through WSL2; GCC 12 or newer for source builds.
35
+ - Benchmarks: time per atom and the largest system per GPU (L40S, A100, MI250X), and time per atom on a CPU.
36
+
37
+ ### Changed defaults
38
+
39
+ - LAMMPS `GRACE_BLAS=AUTO` (see above): with a BLAS other than MKL, OpenBLAS, BLIS or Accelerate the CPU styles use
40
+ the built-in kernel. `-D GRACE_BLAS=ON` uses any BLAS that provides `cblas_sgemm`.
41
+ - macOS: the `torchsim` extra installs no packages.
42
+
43
+ ## [0.1.0](https://github.com/ICAMS/grace-runtime/releases/tag/0.1.0) (2026-10-29)
44
+
45
+ First release on PyPI: `grace-runtime` (CPU), `grace-runtime-cuda12` (NVIDIA) and `grace-runtime-rocm6` (AMD). It
46
+ contains everything of the 0.0.1.dev1 rehearsal below, and the changes listed here.
47
+
48
+ ### Added
49
+
50
+ - **PACE models** (pacemaker's ACE potentials): energies, forces, stress and the extrapolation grade gamma on the CPU,
51
+ NVIDIA and AMD GPUs. `Model` reads the B-basis `.yaml` (and the active set `.asi`) directly. In LAMMPS the style
52
+ `pace/runtime(/kk)` runs them; on GPUs it is 1.3x to 3.0x faster than `pace/kk`, both in double precision.
53
+ - **macOS arm64 wheels** (Apple Silicon, macOS 11 and later).
54
+ - **LAMMPS**: one style `grace/runtime(/kk)` for GRACE-1L, 2L and 3L models. It reads the model kind from the file.
55
+ A keyword that does not fit the model is an error; a keyword of the other backend (CPU or Kokkos) gives a warning.
56
+ A repeated `pair_style` rebuilds the engine from the loaded model.
57
+ - grace-runtime reads the model kind and format version that newer tensorpotential exports write into `kokkos.npz`.
58
+ Older exports still load; a file from a newer exporter stops with a clear message.
59
+ - `Model(store_max_gb=)`, `Model.store_max_gb` and `backend_info["store"]`: the memory budget of the forward store,
60
+ with a `RuntimeWarning` when the store does not fit and the backward pass recomputes it.
61
+ - `Model.compute(positions=, image=, shifts=)` and `NeighborList.image` / `.shifts`: the CPU engines form the bond
62
+ vectors from the positions and a shift index per bond (PACE, 32768 carbon atoms, 20 threads: 16 % faster per step).
63
+ - The documentation site with an API reference.
64
+
65
+ ### Changed
66
+
67
+ - NVIDIA without the `[cublas]` extra: GRACE-3L takes 0-15 % longer than with cuBLAS (0.0.1.dev1: up to 16x), with
68
+ the same results within fp32 rounding. The extra stays optional.
69
+ - The neighbour list keeps 8 bytes per bond instead of 40.
70
+ - `energy_only=True` calls on the CPU skip the derivative work and its buffers (GRACE-1L/2L/3L and D3), and GRACE-3L
71
+ UQ projects all atoms of a block in one matrix product.
72
+ - A GPU calculation that runs out of memory retries with smaller chunks, also when a kernel launch fails.
73
+ - More input checks: atomic numbers, property ranges (`eos_batch`, `elastic_batch`), nearly flat cells, two atoms at
74
+ the same position (an error).
75
+
76
+ ### Changed defaults
77
+
78
+ - `GRACERuntimeCalculator(energy_only=False)`: the first request computes energy, forces and stress together, and
79
+ later requests on the same atoms reuse them. Pass `energy_only=True` for energy-only screening.
80
+ - The forward store (GRACE-2L layer 1, GRACE-3L layers 1-2) follows the available memory per process, in Python and in
81
+ LAMMPS; above it the backward pass recomputes the layers. Before: GRACE-2L a fixed 8 GB, GRACE-3L no limit.
82
+ - The automatic memory budgets (forward store, GRACE-3L radial tables) follow a cgroup memory limit (Slurm `--mem`,
83
+ containers) when there is one, instead of the memory of the node.
84
+ - NVIDIA without cuBLAS: the built-in Kokkos GEMMs run (`blas()` reports `kkgemm`); `GRACE_RUNTIME_NO_KKGEMM=1` brings
85
+ back the earlier kernels. Without the `[cublas]` extra a system cuBLAS 12 is used when found; one older than 12.0
86
+ (12.8 on compute capability 10 and above) is skipped with a warning.
87
+ - The automatic GPU chunk size goes down to 512 atoms when memory is short (before: 1024).
88
+ - C++ builds of libgrace and its tests with CMake: `GRACE_ARCH_FLAGS` defaults to `-march=native`. The Python
89
+ package, the wheels and LAMMPS are not affected.
90
+
91
+ ### Removed
92
+
93
+ - LAMMPS styles `grace/{1l,2l,3l}/fused(/kk)`: use `grace/runtime(/kk)`.
94
+ The TensorFlow styles `grace/1layer/chunk`, `grace/2layer/chunk` and `grace/2layer/parallel`: use `grace/runtime`
95
+ with a `kokkos.npz` export. `pair_style grace` (TensorFlow) and `grace/fs(/kk)` stay.
96
+ - LAMMPS `pace/kk/fp64` (`/device`, `/host`): `pace/kk` runs in double precision again. On GPUs with slow double
97
+ precision it is about 2x slower than its earlier mixed-precision default, which failed the accuracy tests.
98
+
99
+ ### Fixed
100
+
101
+ - Systems above about 33 million atoms on large GPUs (64-bit offsets of the neighbour and bond lists).
102
+ - A GPU batch is usable again after an allocation failure.
103
+ - GRACE-3L on the GPU after a re-setup with other radial-table settings.
104
+ - Open cell directions that are not orthogonal to the periodic ones.
105
+ - AMD RDNA (32-lane) GPUs in the GRACE-2L backward kernel.
106
+ - `free_gpu_memory()` also releases calculators that only a reference cycle keeps alive, and their GPU models.
107
+ - GRACE-3L on the CPU ignored `num_threads` in some loops when `OMP_NUM_THREADS` was larger.
108
+ - `grace-runtime info` with no visible CUDA device.
109
+ - The rocm6 wheels claimed manylinux2014 but need glibc 2.28: they are tagged `manylinux_2_28` now.
110
+ - LAMMPS: `comm_style tiled` with the Kokkos GRACE-2L style gave wrong forces and GRACE-3L stopped; `fix pair` UQ on
111
+ empty CPU ranks; `pace/kk` and `pace/extrapolation/kk` stopped on the GPU for multi-element files without pair
112
+ blocks.
113
+
114
+ ### Known issues
115
+
116
+ - LAMMPS `fix atom/swap` with Kokkos pair styles (also `lj/cut/kk`) makes other swap decisions than on the CPU.
117
+ - LAMMPS `pair_style grace` (TensorFlow) with a two-layer model gives wrong results on more than one MPI rank: use
118
+ `grace/runtime`.
119
+
120
+ ## [0.0.1.dev1](https://github.com/ICAMS/grace-runtime/releases/tag/0.0.1.dev1) (2026-10-26)
121
+
122
+ Pre-release on TestPyPI only: the second rehearsal of the release pipeline, now with the GPU packages
123
+ `grace-runtime-cuda12` (NVIDIA, CUDA 12) and `grace-runtime-rocm6` (AMD, ROCm 6). The GPU packages pin the same
124
+ version of `grace-runtime`: their interface to the CPU package changed in this release.
125
+
126
+ ### Added
127
+
128
+ - **AMD GPUs** (HIP / ROCm 6): the fused GRACE-1L / 2L / 3L engines on MI210 / MI250 / MI250X (gfx90a) and
129
+ MI300A / MI300X (gfx942), in the Python package (`device="rocm"`, `"rocm:N"`) and in the LAMMPS styles
130
+ `grace/{1l,2l,3l}/fused/kk`. Package `grace-runtime-rocm6`.
131
+ - **Batched relaxation**: `relax_batch` and `relax_batch_iter` relax many structures in one GPU batch (FIRE as in
132
+ ASE; optional cell relaxation as `ase.filters.FrechetCellFilter`, pressure, fixed atoms, `fix_symmetry`).
133
+ Structures that converge leave the batch and waiting ones take their place. Command line:
134
+ `grace-runtime relax MODEL IN -o OUT`. `compute_batch_iter` evaluates a stream of structures.
135
+ - **Properties in batches**: `eos_batch` (equation of state), `elastic_batch` (elastic constants, stress method),
136
+ `phonons_batch` and `phonopy_forces_batch` (phonopy).
137
+ - **Dispersion correction DFT-D3(BJ)**, optionally with the Axilrod-Teller-Muto three-body term, on the CPU, CUDA and
138
+ HIP: argument `dispersion=` of the calculator, `compute_batch`, the relaxation and property functions and the
139
+ TorchSim model, as a short form (`"d3-pbe"`, `"d3-r2scan"`, `"d3-pbe-atm"`) or `D3(...)`. Off unless given.
140
+ - `Model` takes a registry name or a `pathlib.Path`; one loaded `Model` can be passed to all functions.
141
+ - CPU kernels for Apple Silicon (NEON, Accelerate); source builds on macOS with Homebrew or conda OpenMP.
142
+ - Example notebook with ASE: energies, relaxations, EOS, elastic constants, UQ, MD.
143
+
144
+ ### Changed
145
+
146
+ - Faster GPU kernels: CUDA bond kernels for GRACE-1L / 2L (A100 2L 4-16 % faster), GRACE-2L / 3L kernels on CUDA,
147
+ matrix-core kernels on AMD GPUs.
148
+ - The GPU calculator builds no CPU neighbour list.
149
+ - GPU per-atom energies: the last step (scale and shift) runs in fp64, as on the CPU; GRACE-1L sums one of its
150
+ intermediate terms in fp64. GPU results change at the level of fp32 rounding (GRACE-1L on strongly compressed
151
+ cells: up to about 1e-4 eV per atom).
152
+ - The engine self-tests compare with the fp32 rounding bound: models whose first-layer outputs cancel, which the GPU
153
+ refused before, now run there.
154
+ - A `Model` loaded with a `spline` other than 1024 uses it on the GPU too (before: always 1024).
155
+ - New errors for inputs that were accepted before: a negative, NaN or infinite `skin`; `GRACE_RUNTIME_STRICT=1` with
156
+ `device="auto"` on a machine without a usable GPU; a malformed `kokkos.npz` (each array is checked against the
157
+ model's own sizes, with a message that names the array).
158
+
159
+ ### Changed defaults
160
+
161
+ - GPU `compute_batch` and the TorchSim model build their neighbour lists on the GPU (before: on the host);
162
+ `num_threads` applies to their CPU paths only.
163
+ - CUDA: GRACE-1L / 2L use the GPU bond kernels (no switch).
164
+ - AMD gfx90a (MI250X): the matrix-core kernels are on by default (`GRACE_FUSED_MFMA=0` turns them off); on gfx94x they
165
+ are opt-in. The GRACE-3L FC fold (`fc_fold = 1`) takes effect on AMD GPUs too.
166
+ - macOS source builds: `GRACE_RUNTIME_ISAS=native`; GRACE-3L CPU matrix products through Accelerate.
167
+
168
+ ### Removed
169
+
170
+ - The matscipy neighbour list backend (`neighbor_backend="matscipy"`) and the `matscipy` extra; the built-in list is
171
+ the only one.
172
+
173
+ ### Fixed
174
+
175
+ - A failed GPU kernel launch stops the run instead of returning wrong results.
176
+ - `free_gpu_memory()` frees every per-atom GPU buffer, also those of the GRACE-3L matrix-core kernels.
177
+ - A forced older GPU module (PTX) needs a driver for CUDA 12.9 or newer; this is checked.
178
+ - GRACE-1L on Turing GPUs (RTX 20xx, T4): kernel launch bounds.
179
+ - Runs with no central atoms (empty MPI ranks): neighbour count and UQ.
180
+ - GPU bond compaction with atoms of unmapped elements.
181
+ - `GRACE_RUNTIME_ROCM_ARCH` works when the architecture cannot be read from the PCI bus.
182
+ - Build warnings with GCC 16.
183
+
184
+ ## [0.0.1.dev0](https://github.com/ICAMS/grace-runtime/releases/tag/0.0.1.dev0) (2026-10-20)
185
+
186
+ Pre-release on TestPyPI only, to test the release pipeline: the CPU package `grace-runtime` (manylinux2014 x86_64
187
+ wheels for CPython 3.10, 3.11 and >= 3.12, with x86-64-v3 and x86-64-v4 builds).