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