phono3py-gpu 1.0.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.
- phono3py_gpu-1.0.0/LICENSE +26 -0
- phono3py_gpu-1.0.0/LICENSE.phono3py +26 -0
- phono3py_gpu-1.0.0/LICENSE.phonopy +26 -0
- phono3py_gpu-1.0.0/LICENSE.wte +28 -0
- phono3py_gpu-1.0.0/PKG-INFO +151 -0
- phono3py_gpu-1.0.0/README.md +125 -0
- phono3py_gpu-1.0.0/pyproject.toml +45 -0
- phono3py_gpu-1.0.0/setup.cfg +4 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/__init__.py +19 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/_wte.py +521 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/backend.py +65 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/batching.py +211 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/collision.py +432 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/eigensolver.py +222 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/factory.py +353 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/fourier.py +474 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/harmonic.py +258 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/initialization.py +50 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/integration.py +183 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/interaction.py +270 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/isotope.py +116 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kappa.py +39 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kernels/collision.cu +11 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kernels/degeneracy.cu +36 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kernels/interaction.cu +89 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kernels/isotope.cu +28 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kernels/scattering.cu +85 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/kernels/tetrahedron.cu +801 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/multigpu.py +347 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/scattering.py +449 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu/velocity.py +175 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu.egg-info/PKG-INFO +151 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu.egg-info/SOURCES.txt +45 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu.egg-info/dependency_links.txt +1 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu.egg-info/entry_points.txt +2 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu.egg-info/requires.txt +15 -0
- phono3py_gpu-1.0.0/src/phono3py_gpu.egg-info/top_level.txt +1 -0
- phono3py_gpu-1.0.0/tests/test_batching.py +244 -0
- phono3py_gpu-1.0.0/tests/test_collision.py +124 -0
- phono3py_gpu-1.0.0/tests/test_initialization.py +69 -0
- phono3py_gpu-1.0.0/tests/test_kernels.py +489 -0
- phono3py_gpu-1.0.0/tests/test_multigpu.py +405 -0
- phono3py_gpu-1.0.0/tests/test_options.py +232 -0
- phono3py_gpu-1.0.0/tests/test_registration.py +26 -0
- phono3py_gpu-1.0.0/tests/test_sigma_reuse.py +113 -0
- phono3py_gpu-1.0.0/tests/test_triplets.py +50 -0
- phono3py_gpu-1.0.0/tests/test_workflows.py +274 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2015-2024, Phonopy. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
* Neither the name of the phonopy project nor the
|
|
13
|
+
names of its contributors may be used to endorse or promote products
|
|
14
|
+
derived from this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT
|
|
20
|
+
HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2015-2024, Phonopy. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
* Neither the name of the phonopy project nor the
|
|
13
|
+
names of its contributors may be used to endorse or promote products
|
|
14
|
+
derived from this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT
|
|
20
|
+
HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2014-2024, Phonopy. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
|
11
|
+
documentation and/or other materials provided with the distribution.
|
|
12
|
+
* Neither the name of the phonopy project nor the
|
|
13
|
+
names of its contributors may be used to endorse or promote products
|
|
14
|
+
derived from this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT
|
|
20
|
+
HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Atsushi Togo
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phono3py-gpu
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: GPU plugin for phono3py
|
|
5
|
+
License-Expression: BSD-3-Clause
|
|
6
|
+
Project-URL: Repository, https://github.com/MoseyQAQ/phono3py-gpu
|
|
7
|
+
Project-URL: Issues, https://github.com/MoseyQAQ/phono3py-gpu/issues
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: LICENSE.phono3py
|
|
12
|
+
License-File: LICENSE.phonopy
|
|
13
|
+
License-File: LICENSE.wte
|
|
14
|
+
Requires-Dist: phono3py>=4.11.0
|
|
15
|
+
Requires-Dist: phonopy>=4.11.0
|
|
16
|
+
Requires-Dist: phonors>=0.9.0
|
|
17
|
+
Provides-Extra: cuda11
|
|
18
|
+
Requires-Dist: cupy-cuda11x<14,>=13.6; extra == "cuda11"
|
|
19
|
+
Provides-Extra: cuda12
|
|
20
|
+
Requires-Dist: cupy-cuda12x>=13.6; extra == "cuda12"
|
|
21
|
+
Provides-Extra: cuda13
|
|
22
|
+
Requires-Dist: cupy-cuda13x>=13.6; extra == "cuda13"
|
|
23
|
+
Provides-Extra: test
|
|
24
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# phono3py-gpu
|
|
28
|
+
|
|
29
|
+
English | [简体中文](README_CN.md)
|
|
30
|
+
|
|
31
|
+
- **A phono3py plugin** that works with your existing phono3py workflows.
|
|
32
|
+
- **Single- and multi-GPU acceleration** for lattice thermal conductivity on NVIDIA GPUs.
|
|
33
|
+
- **10–50× speedups in selected benchmarks**.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
Requirements:
|
|
38
|
+
|
|
39
|
+
- Python >=3.11
|
|
40
|
+
- phono3py >=4.11.0
|
|
41
|
+
- phonopy >=4.11.0
|
|
42
|
+
- phonors >=0.9.0
|
|
43
|
+
- CuPy >=13.6 (CUDA 11: <14)
|
|
44
|
+
- An NVIDIA GPU with a compatible driver
|
|
45
|
+
- CUDA Toolkit matching your CuPy installation
|
|
46
|
+
|
|
47
|
+
Choose **one** CUDA option for your environment:
|
|
48
|
+
|
|
49
|
+
| CUDA Toolkit | Installation option |
|
|
50
|
+
|---|---|
|
|
51
|
+
| 11.2–11.8 | `cuda11` |
|
|
52
|
+
| 12.x | `cuda12` |
|
|
53
|
+
| 13.x | `cuda13` |
|
|
54
|
+
|
|
55
|
+
The example below uses **CUDA 12**. Replace `cuda12` if needed:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
git clone https://github.com/MoseyQAQ/phono3py-gpu.git
|
|
59
|
+
cd phono3py-gpu
|
|
60
|
+
pip3 install '.[cuda12]'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If a compatible CuPy is already installed, use `pip3 install .` instead.
|
|
64
|
+
|
|
65
|
+
## Quick start
|
|
66
|
+
|
|
67
|
+
### CLI
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Run in a calculation directory containing matching input files:
|
|
71
|
+
# phono3py_params.yaml: structure and supercells
|
|
72
|
+
# fc2.hdf5: second-order force constants
|
|
73
|
+
# fc3.hdf5: third-order force constants
|
|
74
|
+
# Input preparation: https://phonopy.github.io/phono3py/
|
|
75
|
+
|
|
76
|
+
# BTE-RTA at 300 K using GPU
|
|
77
|
+
phono3py --br --tt GPU --mesh 9 9 9 --ts 300
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Results are written to a `kappa-*.hdf5` file in the calculation directory.
|
|
81
|
+
|
|
82
|
+
### API
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
import phono3py
|
|
86
|
+
|
|
87
|
+
ph3 = phono3py.load(
|
|
88
|
+
"phono3py_params.yaml",
|
|
89
|
+
fc2_filename="fc2.hdf5",
|
|
90
|
+
fc3_filename="fc3.hdf5",
|
|
91
|
+
)
|
|
92
|
+
ph3.mesh_numbers = [9, 9, 9]
|
|
93
|
+
ph3.init_phph_interaction()
|
|
94
|
+
ph3.run_thermal_conductivity(
|
|
95
|
+
temperatures=[300],
|
|
96
|
+
transport_type="GPU", # Important
|
|
97
|
+
write_kappa=True,
|
|
98
|
+
)
|
|
99
|
+
print(ph3.thermal_conductivity.kappa)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
In an existing Python calculation, select the plugin with `transport_type="GPU"` or `"WTE-GPU"`.
|
|
103
|
+
|
|
104
|
+
## Supported transport methods
|
|
105
|
+
|
|
106
|
+
| Method | Python `transport_type` | Python `is_LBTE` | CLI options |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| BTE-RTA | `"GPU"` | `False` (default) | `--br --tt GPU` |
|
|
109
|
+
| LBTE | `"GPU"` | `True` | `--lbte --tt GPU` |
|
|
110
|
+
| WTE-RTA | `"WTE-GPU"` | `False` (default) | `--br --tt WTE-GPU` |
|
|
111
|
+
| WTE-LBTE | `"WTE-GPU"` | `True` | `--lbte --tt WTE-GPU` |
|
|
112
|
+
|
|
113
|
+
WTE is included; no separate phono3py-wte installation is needed.
|
|
114
|
+
|
|
115
|
+
To read the final q point’s three-phonon interaction strengths in Python after GPU LBTE or WTE-LBTE, set `PHONO3PY_GPU_RETAIN_PP=1`. [Details](docs/advanced.md#performance-tuning)
|
|
116
|
+
|
|
117
|
+
## Use multiple GPUs
|
|
118
|
+
|
|
119
|
+
Calculations use all visible GPUs on the same machine. Set `CUDA_VISIBLE_DEVICES` before starting to select GPUs; for example, to use GPUs 0 and 1:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
CUDA_VISIBLE_DEVICES=0,1 phono3py --br --tt GPU --mesh 9 9 9 --ts 300 \
|
|
123
|
+
--average-degenerate-weights --exclude-gamma-acoustic
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Use `CUDA_VISIBLE_DEVICES=0` for one GPU. The same setting works with Python scripts. For LBTE, the global solve still uses one GPU by default; see [memory requirements and solver options](docs/advanced.md#out-of-memory).
|
|
127
|
+
|
|
128
|
+
## Performance
|
|
129
|
+
|
|
130
|
+
CPU: AMD Ryzen Threadripper PRO 5995WX (8 threads). GPU: NVIDIA Tesla V100 (16 GB). Times are in seconds.
|
|
131
|
+
|
|
132
|
+
| Case | Phonon branches | Mesh | CPU | 1 GPU | 2 GPUs | 4 GPUs |
|
|
133
|
+
|---|---:|---|---:|---:|---:|---:|
|
|
134
|
+
| Si · BTE-RTA | 24 | 19³ | 178.8 | 26.9 | 15.7 | 9.7 |
|
|
135
|
+
| AlN · BTE-RTA | 12 | 25×25×17 | 286.8 | 39.0 | 25.1 | 16.8 |
|
|
136
|
+
| ABO · LBTE | 60 | 6×6×5 | 301.8 | 11.9 | 10.1 | 9.3 |
|
|
137
|
+
| ABO · WTE-RTA | 60 | 6×6×5 | 266.2 | 9.1 | 7.5 | 6.6 |
|
|
138
|
+
|
|
139
|
+
## Help and contributing
|
|
140
|
+
|
|
141
|
+
- [Troubleshooting and advanced usage](docs/advanced.md): GPU detection, multiple GPUs, memory, and tuning.
|
|
142
|
+
- [phono3py documentation](https://phonopy.github.io/phono3py/): input preparation and transport settings.
|
|
143
|
+
- [GitHub Issues](https://github.com/MoseyQAQ/phono3py-gpu/issues): questions, bug reports, and feature requests.
|
|
144
|
+
|
|
145
|
+
Contributions are welcome. See [development setup](docs/advanced.md#development) for installation and testing instructions.
|
|
146
|
+
|
|
147
|
+
## License and acknowledgements
|
|
148
|
+
|
|
149
|
+
Distributed under the [BSD 3-Clause license](LICENSE).
|
|
150
|
+
|
|
151
|
+
This project builds on [phono3py](https://github.com/phonopy/phono3py), [phonopy](https://github.com/phonopy/phonopy), and [phono3py-wte](https://github.com/MSimoncelli/phono3py-wte). Their notices are included in [LICENSE.phono3py](LICENSE.phono3py), [LICENSE.phonopy](LICENSE.phonopy), and [LICENSE.wte](LICENSE.wte).
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# phono3py-gpu
|
|
2
|
+
|
|
3
|
+
English | [简体中文](README_CN.md)
|
|
4
|
+
|
|
5
|
+
- **A phono3py plugin** that works with your existing phono3py workflows.
|
|
6
|
+
- **Single- and multi-GPU acceleration** for lattice thermal conductivity on NVIDIA GPUs.
|
|
7
|
+
- **10–50× speedups in selected benchmarks**.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Requirements:
|
|
12
|
+
|
|
13
|
+
- Python >=3.11
|
|
14
|
+
- phono3py >=4.11.0
|
|
15
|
+
- phonopy >=4.11.0
|
|
16
|
+
- phonors >=0.9.0
|
|
17
|
+
- CuPy >=13.6 (CUDA 11: <14)
|
|
18
|
+
- An NVIDIA GPU with a compatible driver
|
|
19
|
+
- CUDA Toolkit matching your CuPy installation
|
|
20
|
+
|
|
21
|
+
Choose **one** CUDA option for your environment:
|
|
22
|
+
|
|
23
|
+
| CUDA Toolkit | Installation option |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 11.2–11.8 | `cuda11` |
|
|
26
|
+
| 12.x | `cuda12` |
|
|
27
|
+
| 13.x | `cuda13` |
|
|
28
|
+
|
|
29
|
+
The example below uses **CUDA 12**. Replace `cuda12` if needed:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/MoseyQAQ/phono3py-gpu.git
|
|
33
|
+
cd phono3py-gpu
|
|
34
|
+
pip3 install '.[cuda12]'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If a compatible CuPy is already installed, use `pip3 install .` instead.
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
### CLI
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Run in a calculation directory containing matching input files:
|
|
45
|
+
# phono3py_params.yaml: structure and supercells
|
|
46
|
+
# fc2.hdf5: second-order force constants
|
|
47
|
+
# fc3.hdf5: third-order force constants
|
|
48
|
+
# Input preparation: https://phonopy.github.io/phono3py/
|
|
49
|
+
|
|
50
|
+
# BTE-RTA at 300 K using GPU
|
|
51
|
+
phono3py --br --tt GPU --mesh 9 9 9 --ts 300
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Results are written to a `kappa-*.hdf5` file in the calculation directory.
|
|
55
|
+
|
|
56
|
+
### API
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
import phono3py
|
|
60
|
+
|
|
61
|
+
ph3 = phono3py.load(
|
|
62
|
+
"phono3py_params.yaml",
|
|
63
|
+
fc2_filename="fc2.hdf5",
|
|
64
|
+
fc3_filename="fc3.hdf5",
|
|
65
|
+
)
|
|
66
|
+
ph3.mesh_numbers = [9, 9, 9]
|
|
67
|
+
ph3.init_phph_interaction()
|
|
68
|
+
ph3.run_thermal_conductivity(
|
|
69
|
+
temperatures=[300],
|
|
70
|
+
transport_type="GPU", # Important
|
|
71
|
+
write_kappa=True,
|
|
72
|
+
)
|
|
73
|
+
print(ph3.thermal_conductivity.kappa)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
In an existing Python calculation, select the plugin with `transport_type="GPU"` or `"WTE-GPU"`.
|
|
77
|
+
|
|
78
|
+
## Supported transport methods
|
|
79
|
+
|
|
80
|
+
| Method | Python `transport_type` | Python `is_LBTE` | CLI options |
|
|
81
|
+
|---|---|---|---|
|
|
82
|
+
| BTE-RTA | `"GPU"` | `False` (default) | `--br --tt GPU` |
|
|
83
|
+
| LBTE | `"GPU"` | `True` | `--lbte --tt GPU` |
|
|
84
|
+
| WTE-RTA | `"WTE-GPU"` | `False` (default) | `--br --tt WTE-GPU` |
|
|
85
|
+
| WTE-LBTE | `"WTE-GPU"` | `True` | `--lbte --tt WTE-GPU` |
|
|
86
|
+
|
|
87
|
+
WTE is included; no separate phono3py-wte installation is needed.
|
|
88
|
+
|
|
89
|
+
To read the final q point’s three-phonon interaction strengths in Python after GPU LBTE or WTE-LBTE, set `PHONO3PY_GPU_RETAIN_PP=1`. [Details](docs/advanced.md#performance-tuning)
|
|
90
|
+
|
|
91
|
+
## Use multiple GPUs
|
|
92
|
+
|
|
93
|
+
Calculations use all visible GPUs on the same machine. Set `CUDA_VISIBLE_DEVICES` before starting to select GPUs; for example, to use GPUs 0 and 1:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
CUDA_VISIBLE_DEVICES=0,1 phono3py --br --tt GPU --mesh 9 9 9 --ts 300 \
|
|
97
|
+
--average-degenerate-weights --exclude-gamma-acoustic
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use `CUDA_VISIBLE_DEVICES=0` for one GPU. The same setting works with Python scripts. For LBTE, the global solve still uses one GPU by default; see [memory requirements and solver options](docs/advanced.md#out-of-memory).
|
|
101
|
+
|
|
102
|
+
## Performance
|
|
103
|
+
|
|
104
|
+
CPU: AMD Ryzen Threadripper PRO 5995WX (8 threads). GPU: NVIDIA Tesla V100 (16 GB). Times are in seconds.
|
|
105
|
+
|
|
106
|
+
| Case | Phonon branches | Mesh | CPU | 1 GPU | 2 GPUs | 4 GPUs |
|
|
107
|
+
|---|---:|---|---:|---:|---:|---:|
|
|
108
|
+
| Si · BTE-RTA | 24 | 19³ | 178.8 | 26.9 | 15.7 | 9.7 |
|
|
109
|
+
| AlN · BTE-RTA | 12 | 25×25×17 | 286.8 | 39.0 | 25.1 | 16.8 |
|
|
110
|
+
| ABO · LBTE | 60 | 6×6×5 | 301.8 | 11.9 | 10.1 | 9.3 |
|
|
111
|
+
| ABO · WTE-RTA | 60 | 6×6×5 | 266.2 | 9.1 | 7.5 | 6.6 |
|
|
112
|
+
|
|
113
|
+
## Help and contributing
|
|
114
|
+
|
|
115
|
+
- [Troubleshooting and advanced usage](docs/advanced.md): GPU detection, multiple GPUs, memory, and tuning.
|
|
116
|
+
- [phono3py documentation](https://phonopy.github.io/phono3py/): input preparation and transport settings.
|
|
117
|
+
- [GitHub Issues](https://github.com/MoseyQAQ/phono3py-gpu/issues): questions, bug reports, and feature requests.
|
|
118
|
+
|
|
119
|
+
Contributions are welcome. See [development setup](docs/advanced.md#development) for installation and testing instructions.
|
|
120
|
+
|
|
121
|
+
## License and acknowledgements
|
|
122
|
+
|
|
123
|
+
Distributed under the [BSD 3-Clause license](LICENSE).
|
|
124
|
+
|
|
125
|
+
This project builds on [phono3py](https://github.com/phonopy/phono3py), [phonopy](https://github.com/phonopy/phonopy), and [phono3py-wte](https://github.com/MSimoncelli/phono3py-wte). Their notices are included in [LICENSE.phono3py](LICENSE.phono3py), [LICENSE.phonopy](LICENSE.phonopy), and [LICENSE.wte](LICENSE.wte).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "phono3py-gpu"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "GPU plugin for phono3py"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "BSD-3-Clause"
|
|
12
|
+
license-files = ["LICENSE", "LICENSE.phono3py", "LICENSE.phonopy", "LICENSE.wte"]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"phono3py>=4.11.0",
|
|
15
|
+
"phonopy>=4.11.0",
|
|
16
|
+
"phonors>=0.9.0",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.urls]
|
|
20
|
+
Repository = "https://github.com/MoseyQAQ/phono3py-gpu"
|
|
21
|
+
Issues = "https://github.com/MoseyQAQ/phono3py-gpu/issues"
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
cuda11 = ["cupy-cuda11x>=13.6,<14"]
|
|
25
|
+
cuda12 = ["cupy-cuda12x>=13.6"]
|
|
26
|
+
cuda13 = ["cupy-cuda13x>=13.6"]
|
|
27
|
+
test = ["pytest>=8"]
|
|
28
|
+
|
|
29
|
+
[project.entry-points."phono3py.conductivity"]
|
|
30
|
+
GPU = "phono3py_gpu:register"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
where = ["src"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.package-data]
|
|
36
|
+
phono3py_gpu = ["kernels/*.cu"]
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
testpaths = ["tests"]
|
|
40
|
+
|
|
41
|
+
[tool.ruff]
|
|
42
|
+
line-length = 88
|
|
43
|
+
|
|
44
|
+
[tool.ruff.lint]
|
|
45
|
+
select = ["E", "F", "I"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""GPU transport plugin; registration does not initialize CUDA."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import version
|
|
4
|
+
|
|
5
|
+
__version__ = version("phono3py-gpu")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def register():
|
|
9
|
+
"""Register GPU calculators and the CPU-only geometry initialization hook."""
|
|
10
|
+
from phono3py.conductivity.factory import _REGISTRY
|
|
11
|
+
|
|
12
|
+
from phono3py_gpu.factory import make_lbte, make_rta
|
|
13
|
+
from phono3py_gpu.initialization import install
|
|
14
|
+
|
|
15
|
+
install()
|
|
16
|
+
_REGISTRY["gpu-rta"] = make_rta
|
|
17
|
+
_REGISTRY["gpu-lbte"] = make_lbte
|
|
18
|
+
_REGISTRY["wte-gpu-rta"] = lambda pp, config: make_rta(pp, config, wte=True)
|
|
19
|
+
_REGISTRY["wte-gpu-lbte"] = lambda pp, config: make_lbte(pp, config, wte=True)
|