grace-runtime-cuda12 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 (113) hide show
  1. grace_runtime_cuda12-0.1.1/CMakeLists.txt +84 -0
  2. grace_runtime_cuda12-0.1.1/LICENSE-Kokkos +228 -0
  3. grace_runtime_cuda12-0.1.1/LICENSE.md +93 -0
  4. grace_runtime_cuda12-0.1.1/PKG-INFO +27 -0
  5. grace_runtime_cuda12-0.1.1/README.md +13 -0
  6. grace_runtime_cuda12-0.1.1/THIRD_PARTY_NOTICES.md +72 -0
  7. grace_runtime_cuda12-0.1.1/cmake/GraceHipAtomics.cmake +40 -0
  8. grace_runtime_cuda12-0.1.1/cmake/GraceRuntime.cmake +31 -0
  9. grace_runtime_cuda12-0.1.1/grace_runtime_cuda12/__init__.py +19 -0
  10. grace_runtime_cuda12-0.1.1/libgrace/include/grace/bonds.h +164 -0
  11. grace_runtime_cuda12-0.1.1/libgrace/include/grace/cell_list.h +256 -0
  12. grace_runtime_cuda12-0.1.1/libgrace/include/grace/coupling.h +54 -0
  13. grace_runtime_cuda12-0.1.1/libgrace/include/grace/cpu_gemm.h +223 -0
  14. grace_runtime_cuda12-0.1.1/libgrace/include/grace/cpu_simd.h +203 -0
  15. grace_runtime_cuda12-0.1.1/libgrace/include/grace/d3.h +622 -0
  16. grace_runtime_cuda12-0.1.1/libgrace/include/grace/d3_params.h +8409 -0
  17. grace_runtime_cuda12-0.1.1/libgrace/include/grace/dispersion.h +68 -0
  18. grace_runtime_cuda12-0.1.1/libgrace/include/grace/error.h +16 -0
  19. grace_runtime_cuda12-0.1.1/libgrace/include/grace/fused_1l.h +101 -0
  20. grace_runtime_cuda12-0.1.1/libgrace/include/grace/fused_2l.h +162 -0
  21. grace_runtime_cuda12-0.1.1/libgrace/include/grace/fused_3l.h +81 -0
  22. grace_runtime_cuda12-0.1.1/libgrace/include/grace/fused_3l_cpu.h +545 -0
  23. grace_runtime_cuda12-0.1.1/libgrace/include/grace/fused_cpu.h +1453 -0
  24. grace_runtime_cuda12-0.1.1/libgrace/include/grace/fused_cpu_types.h +190 -0
  25. grace_runtime_cuda12-0.1.1/libgrace/include/grace/hd.h +11 -0
  26. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/blas.h +280 -0
  27. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/csr_images.h +366 -0
  28. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/cublas_guard.h +111 -0
  29. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/d3_kk.h +626 -0
  30. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/fused_common.h +235 -0
  31. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/fused_dense.h +649 -0
  32. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/fused_hip_bonds.h +427 -0
  33. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/g1l_shape_large.h +3954 -0
  34. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/g2l_shape_smaxl.h +20295 -0
  35. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/g2l_shape_smaxm.h +12389 -0
  36. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_1l_fused_kk.h +111 -0
  37. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_1l_fused_kk_impl.h +856 -0
  38. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_1l_kk.h +592 -0
  39. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_1l_kk_impl.h +3139 -0
  40. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_2l_fused_kk.h +223 -0
  41. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_2l_fused_kk_impl.h +2457 -0
  42. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_2l_kk.h +942 -0
  43. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_2l_kk_impl.h +5579 -0
  44. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_fused_kk.h +28 -0
  45. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk.h +1485 -0
  46. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_cpl.h +880 -0
  47. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_cpl_path.h +248 -0
  48. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_dense.h +1221 -0
  49. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_impl.h +4244 -0
  50. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_radial.h +833 -0
  51. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_spbf.h +2057 -0
  52. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/grace_3l_kk_spbf_mfma.h +689 -0
  53. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/kk_gemm.h +398 -0
  54. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/kk_mfma.h +198 -0
  55. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/neighbors_kk.h +684 -0
  56. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/pace_kk.h +1201 -0
  57. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/rocblas_guard.h +78 -0
  58. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/support.h +500 -0
  59. grace_runtime_cuda12-0.1.1/libgrace/include/grace/kk/traits.h +55 -0
  60. grace_runtime_cuda12-0.1.1/libgrace/include/grace/model_1l.h +137 -0
  61. grace_runtime_cuda12-0.1.1/libgrace/include/grace/model_2l.h +197 -0
  62. grace_runtime_cuda12-0.1.1/libgrace/include/grace/model_3l.h +192 -0
  63. grace_runtime_cuda12-0.1.1/libgrace/include/grace/model_kind.h +25 -0
  64. grace_runtime_cuda12-0.1.1/libgrace/include/grace/pace_cpu.h +51 -0
  65. grace_runtime_cuda12-0.1.1/libgrace/include/grace/pace_embedding.h +110 -0
  66. grace_runtime_cuda12-0.1.1/libgrace/include/grace/pace_model.h +70 -0
  67. grace_runtime_cuda12-0.1.1/libgrace/include/grace/pace_radial.h +371 -0
  68. grace_runtime_cuda12-0.1.1/libgrace/include/grace/pace_tables.h +57 -0
  69. grace_runtime_cuda12-0.1.1/libgrace/include/grace/system.h +123 -0
  70. grace_runtime_cuda12-0.1.1/libgrace/include/grace/type_map.h +36 -0
  71. grace_runtime_cuda12-0.1.1/libgrace/include/grace/uq.h +56 -0
  72. grace_runtime_cuda12-0.1.1/libgrace/include/grace/uq_head.h +34 -0
  73. grace_runtime_cuda12-0.1.1/libgrace/src/fused_1l.cpp +633 -0
  74. grace_runtime_cuda12-0.1.1/libgrace/src/fused_2l.cpp +1182 -0
  75. grace_runtime_cuda12-0.1.1/libgrace/src/fused_3l.cpp +1644 -0
  76. grace_runtime_cuda12-0.1.1/libgrace/src/model_1l.cpp +290 -0
  77. grace_runtime_cuda12-0.1.1/libgrace/src/model_2l.cpp +478 -0
  78. grace_runtime_cuda12-0.1.1/libgrace/src/model_3l.cpp +464 -0
  79. grace_runtime_cuda12-0.1.1/libgrace/src/model_kind.cpp +139 -0
  80. grace_runtime_cuda12-0.1.1/libgrace/src/npz3.h +406 -0
  81. grace_runtime_cuda12-0.1.1/libgrace/src/pace_convert.cpp +1078 -0
  82. grace_runtime_cuda12-0.1.1/libgrace/src/pace_convert.h +48 -0
  83. grace_runtime_cuda12-0.1.1/libgrace/src/pace_cpu.cpp +678 -0
  84. grace_runtime_cuda12-0.1.1/libgrace/src/pace_model.cpp +159 -0
  85. grace_runtime_cuda12-0.1.1/libgrace/src/pace_tables.cpp +95 -0
  86. grace_runtime_cuda12-0.1.1/libgrace/src/pace_yaml.cpp +355 -0
  87. grace_runtime_cuda12-0.1.1/libgrace/src/pace_yaml.h +38 -0
  88. grace_runtime_cuda12-0.1.1/libgrace/src/uq.cpp +31 -0
  89. grace_runtime_cuda12-0.1.1/libgrace/src/uq_head.cpp +92 -0
  90. grace_runtime_cuda12-0.1.1/libgrace/third_party/d3_data/LICENSE +202 -0
  91. grace_runtime_cuda12-0.1.1/libgrace/third_party/grace_cnpy/LICENSE +21 -0
  92. grace_runtime_cuda12-0.1.1/libgrace/third_party/grace_cnpy/cnpy.cpp +381 -0
  93. grace_runtime_cuda12-0.1.1/libgrace/third_party/grace_cnpy/cnpy.h +284 -0
  94. grace_runtime_cuda12-0.1.1/pyproject.toml +32 -0
  95. grace_runtime_cuda12-0.1.1/python/kk/CMakeLists.txt +116 -0
  96. grace_runtime_cuda12-0.1.1/python/kk/kk_api.h +156 -0
  97. grace_runtime_cuda12-0.1.1/python/kk/kk_core.cpp +1501 -0
  98. grace_runtime_cuda12-0.1.1/python/kk/kk_core_3l.cpp +8 -0
  99. grace_runtime_cuda12-0.1.1/python/kk/kk_module.cpp +273 -0
  100. grace_runtime_cuda12-0.1.1/python/src/core.cpp +529 -0
  101. grace_runtime_cuda12-0.1.1/python/src/dispersion_args.h +35 -0
  102. grace_runtime_cuda12-0.1.1/python/src/exports.map +2 -0
  103. grace_runtime_cuda12-0.1.1/python/src/neighbors.cpp +97 -0
  104. grace_runtime_cuda12-0.1.1/python/src/neighbors.h +26 -0
  105. grace_runtime_cuda12-0.0.0.dev0/PKG-INFO +0 -15
  106. grace_runtime_cuda12-0.0.0.dev0/README.md +0 -4
  107. grace_runtime_cuda12-0.0.0.dev0/grace_runtime_cuda12.egg-info/PKG-INFO +0 -15
  108. grace_runtime_cuda12-0.0.0.dev0/grace_runtime_cuda12.egg-info/SOURCES.txt +0 -7
  109. grace_runtime_cuda12-0.0.0.dev0/grace_runtime_cuda12.egg-info/dependency_links.txt +0 -1
  110. grace_runtime_cuda12-0.0.0.dev0/grace_runtime_cuda12.egg-info/top_level.txt +0 -1
  111. grace_runtime_cuda12-0.0.0.dev0/pyproject.toml +0 -19
  112. grace_runtime_cuda12-0.0.0.dev0/setup.cfg +0 -4
  113. grace_runtime_cuda12-0.0.0.dev0/setup.py +0 -8
@@ -0,0 +1,84 @@
1
+ # SPDX-License-Identifier: LicenseRef-ASL (Academic Software Licence, see LICENSE.md)
2
+ # grace-runtime-cuda12: one sub-build of python/kk per GPU architecture (ExternalProject: each with its own static
3
+ # Kokkos, so the Kokkos installs never meet in one CMake project); the modules go into grace_runtime_cuda12.
4
+ # GRACE_KK_ARCHS architectures (CMake or environment, "," or ";"), default sm70;sm80;sm90;sm100;sm120
5
+ # (sm75 devices use sm70, 3-6 % slower than an sm75 build on an RTX 2070; sm86 / sm87 /
6
+ # sm89 devices use sm80, as fast or faster than their own builds on RTX 3090 / 4070 SUPER;
7
+ # sm103 (B300 / GB300) uses sm100, sm121 uses sm120)
8
+ # GRACE_KOKKOS_ROOT_<ARCH> (environment) an installed Kokkos per architecture (CUDA, static, PIC, C++20), e.g.
9
+ # GRACE_KOKKOS_ROOT_SM80; else the pinned Kokkos release is built (GRACE_KOKKOS_SOURCE:
10
+ # a local Kokkos source tree for offline builds)
11
+ # GRACE_KK_CUBLAS dlopen (default: cuBLAS loaded at run time when installed) or link
12
+ # The C++ compiler (CXX) is the host compiler of nvcc; nvcc from PATH or CUDACXX.
13
+ cmake_minimum_required(VERSION 3.24)
14
+ project(grace_runtime_cuda12 NONE)
15
+ include(ExternalProject)
16
+
17
+ set(GRACE_KK_ARCHS "sm70;sm80;sm90;sm100;sm120" CACHE STRING "GPU architectures, one module each")
18
+ if(DEFINED ENV{GRACE_KK_ARCHS}) # environment (pip / build): "sm80,sm89" or "sm80;sm89"
19
+ string(REPLACE "," ";" GRACE_KK_ARCHS "$ENV{GRACE_KK_ARCHS}")
20
+ endif()
21
+ set(GRACE_KK_CUBLAS "dlopen" CACHE STRING "cuBLAS: dlopen or link")
22
+ set(GRACE_KOKKOS_VERSION "5.2.2")
23
+ set(GRACE_KOKKOS_SHA256 "d6557aaef39302282a15f9c770433d1fcdf4e961dfd6d9ed726b9d0d0f546b9f")
24
+ set(GRACE_KOKKOS_URL "https://github.com/kokkos/kokkos/releases/download/${GRACE_KOKKOS_VERSION}/kokkos-${GRACE_KOKKOS_VERSION}.tar.gz")
25
+ set(GRACE_KOKKOS_SOURCE "" CACHE PATH "Kokkos source tree (offline builds); empty: the pinned release")
26
+
27
+ # sources: staged next to this file (sdist), else the repository around python-cuda/
28
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/python/kk/CMakeLists.txt")
29
+ set(_root "${CMAKE_CURRENT_SOURCE_DIR}")
30
+ else()
31
+ get_filename_component(_root "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
32
+ endif()
33
+ find_package(Python 3.10 COMPONENTS Interpreter REQUIRED)
34
+ set(_cxx "$ENV{CXX}")
35
+ if(NOT _cxx)
36
+ find_program(_cxx NAMES g++ c++ REQUIRED)
37
+ endif()
38
+ set(_nvcc "$ENV{CUDACXX}")
39
+ if(NOT _nvcc)
40
+ find_program(_nvcc nvcc REQUIRED)
41
+ endif()
42
+ set(_kokkos_arch_sm70 VOLTA70)
43
+ set(_kokkos_arch_sm75 TURING75)
44
+ set(_kokkos_arch_sm80 AMPERE80)
45
+ set(_kokkos_arch_sm86 AMPERE86)
46
+ set(_kokkos_arch_sm89 ADA89)
47
+ set(_kokkos_arch_sm90 HOPPER90)
48
+ set(_kokkos_arch_sm100 BLACKWELL100)
49
+ set(_kokkos_arch_sm120 BLACKWELL120)
50
+ set(_stage "${CMAKE_CURRENT_BINARY_DIR}/stage")
51
+ set(_prev "") # architectures one after another: four parallel nvcc builds of the engines exhaust a runner's memory
52
+
53
+ foreach(arch IN LISTS GRACE_KK_ARCHS)
54
+ if(NOT DEFINED _kokkos_arch_${arch})
55
+ message(FATAL_ERROR "GRACE_KK_ARCHS: unknown architecture ${arch} (sm70, sm75, sm80, sm86, sm89, sm90, sm100, sm120)")
56
+ endif()
57
+ string(TOUPPER "${arch}" _ARCH)
58
+ set(_kroot "$ENV{GRACE_KOKKOS_ROOT_${_ARCH}}")
59
+ set(_deps ${_prev})
60
+ if(NOT _kroot)
61
+ set(_kroot "${CMAKE_CURRENT_BINARY_DIR}/kokkos-${arch}")
62
+ if(GRACE_KOKKOS_SOURCE)
63
+ set(_src SOURCE_DIR "${GRACE_KOKKOS_SOURCE}")
64
+ else()
65
+ set(_src URL "${GRACE_KOKKOS_URL}" URL_HASH "SHA256=${GRACE_KOKKOS_SHA256}")
66
+ endif()
67
+ ExternalProject_Add(kokkos_${arch} ${_src}
68
+ CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${_kroot} -DCMAKE_CXX_COMPILER=${_cxx}
69
+ -DCMAKE_CUDA_COMPILER=${_nvcc} -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_SERIAL=ON
70
+ -DKokkos_ARCH_${_kokkos_arch_${arch}}=ON -DCMAKE_CXX_STANDARD=20 -DBUILD_SHARED_LIBS=OFF
71
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
72
+ list(APPEND _deps kokkos_${arch})
73
+ endif()
74
+ ExternalProject_Add(kk_${arch}
75
+ SOURCE_DIR "${_root}/python/kk"
76
+ CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${_stage} -DCMAKE_CXX_COMPILER=${_cxx}
77
+ -DKokkos_ROOT=${_kroot} -DGRACE_KK_ARCH=${arch} -DGRACE_KK_PACKAGE=grace_runtime_cuda12
78
+ -DGRACE_KK_CUBLAS=${GRACE_KK_CUBLAS} -DPython_EXECUTABLE=${Python_EXECUTABLE}
79
+ "-DSKBUILD_SABI_COMPONENT=${SKBUILD_SABI_COMPONENT}"
80
+ BUILD_ALWAYS ON
81
+ DEPENDS ${_deps})
82
+ set(_prev kk_${arch})
83
+ endforeach()
84
+ install(DIRECTORY "${_stage}/grace_runtime_cuda12/" DESTINATION grace_runtime_cuda12)
@@ -0,0 +1,228 @@
1
+ ==============================================================================
2
+ Kokkos is under the Apache License v2.0 with LLVM Exceptions:
3
+ ==============================================================================
4
+
5
+ Apache License
6
+ Version 2.0, January 2004
7
+ http://www.apache.org/licenses/
8
+
9
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10
+
11
+ 1. Definitions.
12
+
13
+ "License" shall mean the terms and conditions for use, reproduction,
14
+ and distribution as defined by Sections 1 through 9 of this document.
15
+
16
+ "Licensor" shall mean the copyright owner or entity authorized by
17
+ the copyright owner that is granting the License.
18
+
19
+ "Legal Entity" shall mean the union of the acting entity and all
20
+ other entities that control, are controlled by, or are under common
21
+ control with that entity. For the purposes of this definition,
22
+ "control" means (i) the power, direct or indirect, to cause the
23
+ direction or management of such entity, whether by contract or
24
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
25
+ outstanding shares, or (iii) beneficial ownership of such entity.
26
+
27
+ "You" (or "Your") shall mean an individual or Legal Entity
28
+ exercising permissions granted by this License.
29
+
30
+ "Source" form shall mean the preferred form for making modifications,
31
+ including but not limited to software source code, documentation
32
+ source, and configuration files.
33
+
34
+ "Object" form shall mean any form resulting from mechanical
35
+ transformation or translation of a Source form, including but
36
+ not limited to compiled object code, generated documentation,
37
+ and conversions to other media types.
38
+
39
+ "Work" shall mean the work of authorship, whether in Source or
40
+ Object form, made available under the License, as indicated by a
41
+ copyright notice that is included in or attached to the work
42
+ (an example is provided in the Appendix below).
43
+
44
+ "Derivative Works" shall mean any work, whether in Source or Object
45
+ form, that is based on (or derived from) the Work and for which the
46
+ editorial revisions, annotations, elaborations, or other modifications
47
+ represent, as a whole, an original work of authorship. For the purposes
48
+ of this License, Derivative Works shall not include works that remain
49
+ separable from, or merely link (or bind by name) to the interfaces of,
50
+ the Work and Derivative Works thereof.
51
+
52
+ "Contribution" shall mean any work of authorship, including
53
+ the original version of the Work and any modifications or additions
54
+ to that Work or Derivative Works thereof, that is intentionally
55
+ submitted to Licensor for inclusion in the Work by the copyright owner
56
+ or by an individual or Legal Entity authorized to submit on behalf of
57
+ the copyright owner. For the purposes of this definition, "submitted"
58
+ means any form of electronic, verbal, or written communication sent
59
+ to the Licensor or its representatives, including but not limited to
60
+ communication on electronic mailing lists, source code control systems,
61
+ and issue tracking systems that are managed by, or on behalf of, the
62
+ Licensor for the purpose of discussing and improving the Work, but
63
+ excluding communication that is conspicuously marked or otherwise
64
+ designated in writing by the copyright owner as "Not a Contribution."
65
+
66
+ "Contributor" shall mean Licensor and any individual or Legal Entity
67
+ on behalf of whom a Contribution has been received by Licensor and
68
+ subsequently incorporated within the Work.
69
+
70
+ 2. Grant of Copyright License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ copyright license to reproduce, prepare Derivative Works of,
74
+ publicly display, publicly perform, sublicense, and distribute the
75
+ Work and such Derivative Works in Source or Object form.
76
+
77
+ 3. Grant of Patent License. Subject to the terms and conditions of
78
+ this License, each Contributor hereby grants to You a perpetual,
79
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80
+ (except as stated in this section) patent license to make, have made,
81
+ use, offer to sell, sell, import, and otherwise transfer the Work,
82
+ where such license applies only to those patent claims licensable
83
+ by such Contributor that are necessarily infringed by their
84
+ Contribution(s) alone or by combination of their Contribution(s)
85
+ with the Work to which such Contribution(s) was submitted. If You
86
+ institute patent litigation against any entity (including a
87
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
88
+ or a Contribution incorporated within the Work constitutes direct
89
+ or contributory patent infringement, then any patent licenses
90
+ granted to You under this License for that Work shall terminate
91
+ as of the date such litigation is filed.
92
+
93
+ 4. Redistribution. You may reproduce and distribute copies of the
94
+ Work or Derivative Works thereof in any medium, with or without
95
+ modifications, and in Source or Object form, provided that You
96
+ meet the following conditions:
97
+
98
+ (a) You must give any other recipients of the Work or
99
+ Derivative Works a copy of this License; and
100
+
101
+ (b) You must cause any modified files to carry prominent notices
102
+ stating that You changed the files; and
103
+
104
+ (c) You must retain, in the Source form of any Derivative Works
105
+ that You distribute, all copyright, patent, trademark, and
106
+ attribution notices from the Source form of the Work,
107
+ excluding those notices that do not pertain to any part of
108
+ the Derivative Works; and
109
+
110
+ (d) If the Work includes a "NOTICE" text file as part of its
111
+ distribution, then any Derivative Works that You distribute must
112
+ include a readable copy of the attribution notices contained
113
+ within such NOTICE file, excluding those notices that do not
114
+ pertain to any part of the Derivative Works, in at least one
115
+ of the following places: within a NOTICE text file distributed
116
+ as part of the Derivative Works; within the Source form or
117
+ documentation, if provided along with the Derivative Works; or,
118
+ within a display generated by the Derivative Works, if and
119
+ wherever such third-party notices normally appear. The contents
120
+ of the NOTICE file are for informational purposes only and
121
+ do not modify the License. You may add Your own attribution
122
+ notices within Derivative Works that You distribute, alongside
123
+ or as an addendum to the NOTICE text from the Work, provided
124
+ that such additional attribution notices cannot be construed
125
+ as modifying the License.
126
+
127
+ You may add Your own copyright statement to Your modifications and
128
+ may provide additional or different license terms and conditions
129
+ for use, reproduction, or distribution of Your modifications, or
130
+ for any such Derivative Works as a whole, provided Your use,
131
+ reproduction, and distribution of the Work otherwise complies with
132
+ the conditions stated in this License.
133
+
134
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
135
+ any Contribution intentionally submitted for inclusion in the Work
136
+ by You to the Licensor shall be under the terms and conditions of
137
+ this License, without any additional terms or conditions.
138
+ Notwithstanding the above, nothing herein shall supersede or modify
139
+ the terms of any separate license agreement you may have executed
140
+ with Licensor regarding such Contributions.
141
+
142
+ 6. Trademarks. This License does not grant permission to use the trade
143
+ names, trademarks, service marks, or product names of the Licensor,
144
+ except as required for reasonable and customary use in describing the
145
+ origin of the Work and reproducing the content of the NOTICE file.
146
+
147
+ 7. Disclaimer of Warranty. Unless required by applicable law or
148
+ agreed to in writing, Licensor provides the Work (and each
149
+ Contributor provides its Contributions) on an "AS IS" BASIS,
150
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
151
+ implied, including, without limitation, any warranties or conditions
152
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
153
+ PARTICULAR PURPOSE. You are solely responsible for determining the
154
+ appropriateness of using or redistributing the Work and assume any
155
+ risks associated with Your exercise of permissions under this License.
156
+
157
+ 8. Limitation of Liability. In no event and under no legal theory,
158
+ whether in tort (including negligence), contract, or otherwise,
159
+ unless required by applicable law (such as deliberate and grossly
160
+ negligent acts) or agreed to in writing, shall any Contributor be
161
+ liable to You for damages, including any direct, indirect, special,
162
+ incidental, or consequential damages of any character arising as a
163
+ result of this License or out of the use or inability to use the
164
+ Work (including but not limited to damages for loss of goodwill,
165
+ work stoppage, computer failure or malfunction, or any and all
166
+ other commercial damages or losses), even if such Contributor
167
+ has been advised of the possibility of such damages.
168
+
169
+ 9. Accepting Warranty or Additional Liability. While redistributing
170
+ the Work or Derivative Works thereof, You may choose to offer,
171
+ and charge a fee for, acceptance of support, warranty, indemnity,
172
+ or other liability obligations and/or rights consistent with this
173
+ License. However, in accepting such obligations, You may act only
174
+ on Your own behalf and on Your sole responsibility, not on behalf
175
+ of any other Contributor, and only if You agree to indemnify,
176
+ defend, and hold each Contributor harmless for any liability
177
+ incurred by, or claims asserted against, such Contributor by reason
178
+ of your accepting any such warranty or additional liability.
179
+
180
+ END OF TERMS AND CONDITIONS Apache 2.0
181
+
182
+ ---- LLVM Exceptions to the Apache 2.0 License ----
183
+
184
+ As an exception, if, as a result of your compiling your source code, portions
185
+ of this Software are embedded into an Object form of such source code, you
186
+ may redistribute such embedded portions in such Object form without complying
187
+ with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
188
+
189
+ In addition, if you combine or link compiled forms of this Software with
190
+ software that is licensed under the GPLv2 ("Combined Software") and if a
191
+ court of competent jurisdiction determines that the patent provision (Section
192
+ 3), the indemnity provision (Section 9) or other Section of the License
193
+ conflicts with the conditions of the GPLv2, you may retroactively and
194
+ prospectively choose to deem waived or otherwise exclude such Section(s) of
195
+ the License, but only in their entirety and only with respect to the Combined
196
+ Software.
197
+
198
+ ==============================================================================
199
+ Software from third parties included in Kokkos:
200
+ ==============================================================================
201
+
202
+ Kokkos contains third party software which is under different license
203
+ terms. All such code will be identified clearly using at least one of two
204
+ mechanisms:
205
+ 1) It will be in a separate directory tree with its own `LICENSE.txt` or
206
+ `LICENSE` file at the top containing the specific license and restrictions
207
+ which apply to that software, or
208
+ 2) It will contain specific license and restriction terms at the top of every
209
+ file.
210
+
211
+
212
+ THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY
213
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
214
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
215
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE
216
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
217
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
218
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
219
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
220
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
221
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
222
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
223
+
224
+ Questions? Contact:
225
+ Christian R. Trott (crtrott@sandia.gov) and
226
+ Damien T. Lebrun-Grandie (lebrungrandt@ornl.gov)
227
+
228
+ ************************************************************************
@@ -0,0 +1,93 @@
1
+ # Academic Software Licence (“ASL”)
2
+
3
+ ## Preamble
4
+
5
+ ASL is a software license that proposes to offer copyleft style rights to use the software in an academic non-commercial setting. The purpose of ASL is to encourage academic cooperation and collaboration free-of-charge whilst enabling academic institutions to earn revenue from the parallel licensing of valuable bodies of software code. Significant proportions of such revenue are typically reinvested in academic research.
6
+
7
+ ASL is not an open-source licence because it does not allow commercial use – it is an “available source” licence, meaning that the source code is made available subject to the terms of this licence and only for academic non-commercial use.
8
+
9
+ ASL is a reciprocal licence very similar to GPL and the core terms are identical to those of GNU GPLv2 (except for the limitation to non-commercial use), making it easier for those who know the GPLv2 to understand the licensing*. As a reciprocal licence, if you redistribute any derivative works you have created based on ASL licenced code, then you are required to license the new work under the ASL - including making your source code available and ensuring that licensees are aware of the terms of the ASL licence.
10
+
11
+ The non-commercial limitation makes ASL incompatible with the GPL and other open-source licences with copyleft provisions because these licences require that modified versions of the original program are made available free of charge for any type of use, including commercial, and this is prevented by ASL. As the two sets of reciprocal terms are incompatible, any modified version of the original program combining ASL and copylefted open-source code can be used internally but cannot be licensed out.
12
+
13
+ The non-commercial restriction is an integral part of the license and you may not remove it without the consent of the rights holder in the ASL licensed code. Please contact __ACEworks GmbH__ (e-mail: contact@aceworks.works) for any questions and/or to enquire about commercial use rights.
14
+
15
+ *The changes to the GPLv2 are: removing the Preamble, replacing the reference to the “General Public License” in clause 0 with a reference to the “ASL”, removing clause 9 and adding clause 13 with the non-commercial restriction and limited patent grant
16
+
17
+ ## TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
18
+
19
+ 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
20
+
21
+ Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
22
+
23
+ 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
24
+ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
25
+
26
+ 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
27
+
28
+ a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
29
+
30
+ b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
31
+
32
+ c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
33
+ These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
34
+ Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
35
+ In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
36
+
37
+ 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
38
+
39
+ a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
40
+
41
+ b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
42
+
43
+ c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
44
+ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
45
+ If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
46
+
47
+ 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
48
+
49
+ 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
50
+
51
+ 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
52
+
53
+ 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
54
+ If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
55
+ It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
56
+ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
57
+
58
+ 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
59
+
60
+ 9. Not used.
61
+
62
+ 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
63
+
64
+ ### NO WARRANTY
65
+
66
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
67
+
68
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
69
+
70
+ ### Non Commercial Use; Limited Patent Rights Grant
71
+
72
+ 13. The Preamble of the GPLv2 does not apply to this License. The Program is provided to you by the Licensor subject to the following conditions, which prevail over any clause or indication to the contrary in the GPLv2:
73
+
74
+ a) The grant of rights under the License is for academic non-commercial use only. Academic non-commercial use is defined as use for academic research or other not-for-profit scholarly purposes, which are undertaken at an educational, non-profit, charitable or governmental institution, and which does not involve and is not intended to lead to the production or manufacture of products for sale, or the enhancement of a product or service in or proposed for commerce, or the performance of services for a fee.
75
+
76
+ b) Subject to your compliance with the License, in the event the Licensor holds patent rights on the Program or any part of it, the Licensor grants you a perpetual, worldwide, non-exclusive, royalty-free, irrevocable (except as stated in this section), limited patent licence to make, use, import and otherwise run, modify and distribute the Program. For the avoidance of doubt, this patent licence is limited to academic non-commercial use, as described above. If you institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program constitutes direct or contributory patent infringement, then any patent license granted to you under this License for the Program shall terminate as of the date such litigation is filed.
77
+
78
+ Use other than academic and non-commercial use as above is deemed to be commercial use and outside the scope of this License. If you intend to use the Program for a commercial use, then you must obtain a commercial use license for the Program. In that case, please contact the original licensor to enquire about commercial use licenses.
79
+
80
+ ## END OF TERMS AND CONDITIONS
81
+
82
+ ## Appendix: Suggested code header and licensing information
83
+ __grace-runtime__ (the `libgrace` C++ library and the `grace-runtime` Python packages) is © 2026, __Ruhr University Bochum__
84
+
85
+ __grace-runtime__ is published and distributed under the Academic Software License v1.0 (ASL).
86
+
87
+ __grace-runtime__ is distributed in the hope that it will be useful for non-commercial academic research, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ASL for more details.
88
+
89
+ You should have received a copy of the ASL along with this program;
90
+
91
+ You may contact the licensor at __contact@aceworks.works__
92
+
93
+ Third-party components bundled with grace-runtime keep their own licences, see `THIRD_PARTY_NOTICES.md`.
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.2
2
+ Name: grace-runtime-cuda12
3
+ Version: 0.1.1
4
+ Summary: NVIDIA GPU backend (CUDA 12) of grace-runtime: fused GRACE-1L/2L/3L Kokkos kernels for V100, RTX 20xx/30xx/40xx/50xx, A100/A30, L40S, H100/H200, B200/B300
5
+ License: Academic Software License (ASL); bundled third-party code (Kokkos: Apache-2.0 WITH LLVM-exception): see THIRD_PARTY_NOTICES.md
6
+ Classifier: License :: Other/Proprietary License
7
+ Project-URL: Homepage, https://github.com/ICAMS/grace-runtime
8
+ Project-URL: Issues, https://github.com/ICAMS/grace-runtime/issues
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: grace-runtime==0.1.1
11
+ Provides-Extra: cublas
12
+ Requires-Dist: nvidia-cublas-cu12<13,>=12.4; extra == "cublas"
13
+ Description-Content-Type: text/markdown
14
+
15
+ # grace-runtime-cuda12
16
+
17
+ NVIDIA CUDA 12 backend for [grace-runtime](https://github.com/ICAMS/grace-runtime), using the shared GRACE-1L/2L/3L kernels.
18
+
19
+ **Current PyPI packages are placeholders.** Once runtime wheels are published:
20
+
21
+ ```bash
22
+ pip install "grace-runtime-cuda12[cublas]"
23
+ ```
24
+
25
+ The matching CPU package is installed automatically. Requires Linux x86-64 and a compatible NVIDIA driver.
26
+ See the [GPU manual](https://github.com/ICAMS/grace-runtime/blob/master/docs/backends.md#nvidia-cuda)
27
+ for supported cards, driver requirements, source builds and the `[cublas]` extra (GRACE-3L ~1.4x faster, UQ slightly faster).
@@ -0,0 +1,13 @@
1
+ # grace-runtime-cuda12
2
+
3
+ NVIDIA CUDA 12 backend for [grace-runtime](https://github.com/ICAMS/grace-runtime), using the shared GRACE-1L/2L/3L kernels.
4
+
5
+ **Current PyPI packages are placeholders.** Once runtime wheels are published:
6
+
7
+ ```bash
8
+ pip install "grace-runtime-cuda12[cublas]"
9
+ ```
10
+
11
+ The matching CPU package is installed automatically. Requires Linux x86-64 and a compatible NVIDIA driver.
12
+ See the [GPU manual](https://github.com/ICAMS/grace-runtime/blob/master/docs/backends.md#nvidia-cuda)
13
+ for supported cards, driver requirements, source builds and the `[cublas]` extra (GRACE-3L ~1.4x faster, UQ slightly faster).
@@ -0,0 +1,72 @@
1
+ # Third-party notices
2
+
3
+ grace-runtime is under the Academic Software Licence (`LICENSE.md`). The following third-party components are
4
+ bundled with it, in source form in this repository or compiled into the wheels; each keeps its own licence.
5
+
6
+ | Component | Where | Licence | Text |
7
+ |---|---|---|---|
8
+ | cnpy (Carl Rogers) | `libgrace/third_party/grace_cnpy/`, compiled into libgrace and all wheels | MIT | `libgrace/third_party/grace_cnpy/LICENSE` |
9
+ | DFT-D3 reference data of tad-dftd3 0.7.0 and tad-mctc 0.8.0 (Grimme Group): reference C6 coefficients and coordination numbers, <r4>/<r2> values, covalent radii, pairwise van der Waals radii | `libgrace/include/grace/d3_params.h` (generated, values verbatim; the pairwise radii rounded back to their 4 decimals in Angstrom), compiled into libgrace and all wheels | Apache-2.0 | `libgrace/third_party/d3_data/LICENSE` |
10
+ | Kokkos (National Technology & Engineering Solutions of Sandia, LLC) | compiled into the `grace-runtime-cuda12` and `grace-runtime-rocm6` wheels (`_kk_<arch>` modules) | Apache-2.0 WITH LLVM-exception | `LICENSE-Kokkos` of each wheel (`python-cuda/`, `python-rocm6/`) |
11
+ | nanobind (Wenzel Jakob) | compiled into the Python extension modules of all wheels | BSD-3-Clause | below |
12
+ | tsl::robin_map (Thibaut Goetghebuer-Planchon), part of nanobind | compiled into the Python extension modules of all wheels | MIT | below |
13
+ | rocPRIM, rocThrust (Advanced Micro Devices, Inc.), HIP headers | header code compiled into the `grace-runtime-rocm6` modules (Kokkos sort) | MIT (rocPRIM, HIP), Apache-2.0 (rocThrust) | https://github.com/ROCm/rocPRIM, https://github.com/ROCm/rocThrust, https://github.com/ROCm/HIP |
14
+ | GCC runtime: libstdc++ (linked statically), libgomp (vendored by auditwheel) | the Linux wheels | GPL-3.0 WITH GCC-exception-3.1 (GCC Runtime Library Exception) | https://www.gnu.org/licenses/gcc-exception-3.1.html |
15
+ | LLVM OpenMP runtime (libomp, conda-forge `llvm-openmp`) | `grace_runtime/.dylibs/libomp.dylib` of the macOS wheels | Apache-2.0 WITH LLVM-exception | `grace_runtime/.dylibs/LICENSE-libomp` of the macOS wheels (`python/LICENSE-libomp`) |
16
+
17
+ Not bundled, loaded at run time when present: the CUDA runtime and driver, cuBLAS (`nvidia-cublas-cu12`, the dense
18
+ GEMMs), rocBLAS of the system ROCm, Accelerate (macOS, part of the system). Not bundled and required by
19
+ `grace-runtime-rocm6`: the ROCm HIP runtime (`libamdhip64.so.6`) of the system ROCm.
20
+
21
+ ## nanobind
22
+
23
+ Copyright (c) 2022 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
24
+
25
+ Redistribution and use in source and binary forms, with or without
26
+ modification, are permitted provided that the following conditions are met:
27
+
28
+ 1. Redistributions of source code must retain the above copyright notice, this
29
+ list of conditions and the following disclaimer.
30
+
31
+ 2. Redistributions in binary form must reproduce the above copyright notice,
32
+ this list of conditions and the following disclaimer in the documentation
33
+ and/or other materials provided with the distribution.
34
+
35
+ 3. Neither the name of the copyright holder nor the names of its contributors
36
+ may be used to endorse or promote products derived from this software
37
+ without specific prior written permission.
38
+
39
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
40
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
41
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
43
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
45
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
46
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
+
50
+ ## tsl::robin_map
51
+
52
+ MIT License
53
+
54
+ Copyright (c) 2017 Thibaut Goetghebuer-Planchon <tessil@gmx.com>
55
+
56
+ Permission is hereby granted, free of charge, to any person obtaining a copy
57
+ of this software and associated documentation files (the "Software"), to deal
58
+ in the Software without restriction, including without limitation the rights
59
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
+ copies of the Software, and to permit persons to whom the Software is
61
+ furnished to do so, subject to the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be included in all
64
+ copies or substantial portions of the Software.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
+ SOFTWARE.
@@ -0,0 +1,40 @@
1
+ # Hardware floating-point atomics for the Kokkos engines on AMD GPUs (HIP backend). Include after find_package(Kokkos).
2
+ # grace_hip_unsafe_fp_atomics(<target>...): compiles <target> with -munsafe-fp-atomics when
3
+ # GRACE_HIP_UNSAFE_FP_ATOMICS resolves to ON. Without the flag, clang lowers fp32/fp64 atomicAdd to global memory
4
+ # into compare-and-swap loops on CDNA; with it, into the hardware FP atomic instructions (5-16 % faster engines on
5
+ # MI250X). The hardware atomics are only correct on coarse-grained device memory (hipMalloc, which is what the
6
+ # Kokkos HIP device views are on a discrete GPU); on fine-grained (host-coherent, managed, system) memory they can
7
+ # silently drop updates.
8
+ # AUTO (default): ON for the discrete CDNA GPUs gfx908, gfx90a, gfx940, gfx941, gfx942 (MI100, MI200, MI300X);
9
+ # OFF for the MI300A APU (Kokkos AMD_GFX942_APU: Kokkos may put device views in unified memory there; untested),
10
+ # for RDNA and other targets, and always OFF without the Kokkos HIP backend (CUDA, host-only).
11
+ # ON / OFF: force it on (HIP only) or off.
12
+ set(GRACE_HIP_UNSAFE_FP_ATOMICS "AUTO" CACHE STRING
13
+ "-munsafe-fp-atomics for the HIP Kokkos engines: AUTO (discrete CDNA GPUs), ON or OFF")
14
+ set_property(CACHE GRACE_HIP_UNSAFE_FP_ATOMICS PROPERTY STRINGS AUTO ON OFF)
15
+
16
+ function(grace_hip_unsafe_fp_atomics)
17
+ string(TOUPPER "${GRACE_HIP_UNSAFE_FP_ATOMICS}" _mode)
18
+ set(_on OFF)
19
+ if(NOT Kokkos_ENABLE_HIP)
20
+ set(_why "no Kokkos HIP backend")
21
+ elseif(_mode STREQUAL "AUTO")
22
+ set(_why "Kokkos_ARCH ${Kokkos_ARCH}")
23
+ foreach(_a IN LISTS Kokkos_ARCH)
24
+ if(_a MATCHES "^(AMD_GFX(908|90A|940|941|942)|VEGA(908|90A))$") # not AMD_GFX942_APU
25
+ set(_on ON)
26
+ endif()
27
+ endforeach()
28
+ elseif(_mode STREQUAL "ON" OR _mode STREQUAL "OFF")
29
+ set(_on ${_mode})
30
+ set(_why "forced")
31
+ else()
32
+ message(FATAL_ERROR "GRACE_HIP_UNSAFE_FP_ATOMICS=${GRACE_HIP_UNSAFE_FP_ATOMICS}: expected AUTO, ON or OFF")
33
+ endif()
34
+ message(STATUS "GRACE_HIP_UNSAFE_FP_ATOMICS=${GRACE_HIP_UNSAFE_FP_ATOMICS}: -munsafe-fp-atomics ${_on} (${_why})")
35
+ if(_on)
36
+ foreach(_t IN LISTS ARGN)
37
+ target_compile_options(${_t} PRIVATE $<$<COMPILE_LANGUAGE:CXX,HIP>:-munsafe-fp-atomics>)
38
+ endforeach()
39
+ endif()
40
+ endfunction()
@@ -0,0 +1,31 @@
1
+ # libgrace: included by the top-level CMakeLists and by LAMMPS' ML-PACE.cmake.
2
+ # GRACE_RUNTIME_SOURCES / GRACE_RUNTIME_INCLUDE_DIRS / GRACE_RUNTIME_PRIVATE_INCLUDE_DIRS: for consumers that
3
+ # compile the sources into their own target (LAMMPS: same flags as the rest of the code, incl. target-specific
4
+ # -march/-mtune from Kokkos), which is the default for consumers.
5
+ # GRACE_RUNTIME_STATIC_LIBRARY=ON (the top level sets it): also define the static library target libgrace.
6
+ get_filename_component(GRACE_RUNTIME_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
7
+ find_package(OpenMP COMPONENTS CXX)
8
+ if(NOT OpenMP_CXX_FOUND)
9
+ message(FATAL_ERROR "OpenMP not found: set OpenMP_ROOT to its prefix (macOS: `brew install libomp` and "
10
+ "$(brew --prefix libomp), or `conda install -c conda-forge llvm-openmp` and $CONDA_PREFIX)")
11
+ endif()
12
+ file(GLOB GRACE_RUNTIME_SOURCES "${GRACE_RUNTIME_ROOT}/libgrace/src/*.cpp")
13
+ list(APPEND GRACE_RUNTIME_SOURCES "${GRACE_RUNTIME_ROOT}/libgrace/third_party/grace_cnpy/cnpy.cpp")
14
+ set(GRACE_RUNTIME_INCLUDE_DIRS "${GRACE_RUNTIME_ROOT}/libgrace/include")
15
+ set(GRACE_RUNTIME_PRIVATE_INCLUDE_DIRS "${GRACE_RUNTIME_ROOT}/libgrace/third_party")
16
+ if(GRACE_RUNTIME_STATIC_LIBRARY)
17
+ add_library(libgrace STATIC ${GRACE_RUNTIME_SOURCES})
18
+ add_library(grace::libgrace ALIAS libgrace)
19
+ target_include_directories(libgrace PUBLIC ${GRACE_RUNTIME_INCLUDE_DIRS} PRIVATE ${GRACE_RUNTIME_PRIVATE_INCLUDE_DIRS})
20
+ target_link_libraries(libgrace PUBLIC OpenMP::OpenMP_CXX)
21
+ # GRACE_BLAS: the GRACE-3L CPU GEMM calls cblas_sgemm (LP64) of a BLAS found by CMake; off: the built-in kernel
22
+ # (the Linux Python wheels; the macOS ones use Accelerate: python/CMakeLists.txt). LAMMPS sets the definition on its
23
+ # own target (ML-PACE.cmake).
24
+ option(GRACE_BLAS "GRACE-3L CPU GEMM through cblas_sgemm" OFF)
25
+ if(GRACE_BLAS)
26
+ find_package(BLAS REQUIRED)
27
+ target_compile_definitions(libgrace PUBLIC GRACE_BLAS)
28
+ target_link_libraries(libgrace PUBLIC ${BLAS_LIBRARIES})
29
+ endif()
30
+ set_target_properties(libgrace PROPERTIES POSITION_INDEPENDENT_CODE ON CXX_VISIBILITY_PRESET hidden)
31
+ endif()
@@ -0,0 +1,19 @@
1
+ # SPDX-License-Identifier: LicenseRef-ASL (Academic Software Licence, see LICENSE.md)
2
+ """NVIDIA GPU backend of grace-runtime (CUDA 12): one module per GPU architecture (_kk_sm80, _kk_sm89, _kk_sm90), each
3
+ with its own static Kokkos; loaded by grace_runtime._cuda through the entry point group grace_runtime.backends."""
4
+ import re
5
+ from pathlib import Path
6
+
7
+ ABI = 6 # = grace_runtime._cuda.ABI (the C++ interface kk_api.h of the modules)
8
+
9
+ try:
10
+ from importlib.metadata import PackageNotFoundError, version
11
+ __version__ = version("grace-runtime-cuda12")
12
+ except PackageNotFoundError: # source tree
13
+ __version__ = "0+unknown"
14
+
15
+
16
+ def archs() -> list:
17
+ """GPU architectures with a module in this package, e.g. ["sm80", "sm89", "sm90"]"""
18
+ here = Path(__file__).parent
19
+ return sorted({m.group(1) for p in here.iterdir() if (m := re.match(r"_kk_(sm\d+)\.", p.name))})