Skip to content

Commit

Permalink
Merge branch 'main' of github.com:FrederikLizakJohansen/DebyeCalculat…
Browse files Browse the repository at this point in the history
…orGPU into main
  • Loading branch information
FrederikLizakJohansen committed Sep 17, 2023
2 parents d137877 + e847e82 commit 3750996
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,24 @@ CLASS DebyeCalculator:
- Return G(r) either on GPU or CPU
```

In order to benchmark our implementation, we compare simulated scattering patterns from DebyeCalculator against DiffPy-CMI,[@juhas2015complex] which is a widely recognised software for scattering pattern computations. Here, our implementation obtains the same scattering patterns as DiffPy-CMI (Supporting Information), while being faster on CPU for structures up to ~72 Å (\autoref{fig:Figure1}). Both calculations are run on a x86-64 CPU with 64GB of memory and a batch size of 10,000.
Running the calculations on the GPU provides another notable boost in speed (\autoref{fig:Figure1}). This improvement primarily stems from the distribution of the double sum calculations across a more extensive set of cores than is feasible on the CPU. With smaller atomic structures, an overhead associated with initiating GPU calculations results in the NVIDIA RTX A3000 Laptop GPU computations being slower than DiffPy-CMI and our CPU implementation. Once the atomic structure size exceeds ~14 Å in diameter, we observe a ~5 times speed-up using an NVIDIA RTX A3000 Laptop GPU with 6GB of memory and a batch size of 10,000.
The choice of GPU hardware has a substantial influence on this speed advantage. As demonstrated in \autoref{fig:Figure1}, using an NVIDIA Titan RTX GPU, which offers 24GB of memory, the speed benefits become even more evident. The NVIDIA Titan RTX GPU delivers a performance that is ~10 times faster, seemingly across all structure sizes, underlining the significant role of the hardware. With the advancements of GPUs like NVIDIA's Grace Hopper Superchip,[@NVIDIA] which boasts 576GB of fast-access to memory, there is potential for DebyeCalculator to achieve even greater speeds in the future.
In order to benchmark our implementation, we compare simulated scattering patterns from DebyeCalculator against DiffPy-CMI,[@juhas2015complex] which is a widely recognised software for scattering pattern computations. Here, our implementation obtains the same scattering patterns as DiffPy-CMI (Supporting Information), while being faster on CPU for structures up to ~72 Å (\autoref{fig:figure_1}). Both calculations are run on a x86-64 CPU with 64GB of memory and a batch size of 10,000.
Running the calculations on the GPU provides another notable boost in speed (\autoref{fig:figure_1}). This improvement primarily stems from the distribution of the double sum calculations across a more extensive set of cores than is feasible on the CPU. With smaller atomic structures, an overhead associated with initiating GPU calculations results in the NVIDIA RTX A3000 Laptop GPU computations being slower than DiffPy-CMI and our CPU implementation. Once the atomic structure size exceeds ~14 Å in diameter, we observe a ~5 times speed-up using an NVIDIA RTX A3000 Laptop GPU with 6GB of memory and a batch size of 10,000.
The choice of GPU hardware has a substantial influence on this speed advantage. As demonstrated in \autoref{fig:figure_1}, using an NVIDIA Titan RTX GPU, which offers 24GB of memory, the speed benefits become even more evident. The NVIDIA Titan RTX GPU delivers a performance that is ~10 times faster, seemingly across all structure sizes, underlining the significant role of the hardware. With the advancements of GPUs like NVIDIA's Grace Hopper Superchip,[@NVIDIA] which boasts 576GB of fast-access to memory, there is potential for DebyeCalculator to achieve even greater speeds in the future.

![Computation-time comparison of the G(r) calculation using our CPU- and GPU-implementations against DiffPy-CMI.[@juhas2015complex] For the CPU-implementation, a batch size of 10,000 was chosen (x86-64 CPU with 6GB). Conversely, the GPU implementations were run with a batch size of 10,000 (NVIDIA RTX A3000 Laptop GPU with 6GB of memory and NVIDIA Titan RTX GPU with 24GB of memory).\label{fig:Figure1}](../figures/Figure1.png)
![Computation-time comparison of the G(r) calculation using our CPU- and GPU-implementations against DiffPy-CMI.[@juhas2015complex] For the CPU-implementation, a batch size of 10,000 was chosen (x86-64 CPU with 6GB). Conversely, the GPU implementations were run with a batch size of 10,000 (NVIDIA RTX A3000 Laptop GPU with 6GB of memory and NVIDIA Titan RTX GPU with 24GB of memory).\label{fig:figure_1}](../figures/figure_1.png)

# Statement of need

Several software packages already exist for simulating the Debye scattering equation, including DiffPy-CMI,[@juhas2015complex] debyer,[@debyer] Debussy,[@cervellino2010debussy; @cervellino2015debussy] TOPAS,[@coelho2018topas] and BCL::SAXS.[@putnam2015bcl] Our software distinguishes itself in several ways. Firstly, it is freely available and open-source licensed under the Apache License 2.0. Moreover, it is conveniently implemented as a ‘pip’ install package and has been integrated with Google Colab[https://github.com/FrederikLizakJohansen/DebyeCalculatorGPU/blob/main/quickstart/QuickStart.ipynb], allowing users to rapidly calculate the Debye scattering equation without the need of local software installations. DebyeCalculator can be run on both CPU, GPU and through an interactive interface (see \autoref{fig:figure2}), where users can calculate I(Q), S(Q), F(Q) and G(r) from structural models with one click.
Several software packages already exist for simulating the Debye scattering equation, including DiffPy-CMI,[@juhas2015complex] debyer,[@debyer] Debussy,[@cervellino2010debussy; @cervellino2015debussy] TOPAS,[@coelho2018topas] and BCL::SAXS.[@putnam2015bcl] Our software distinguishes itself in several ways. Firstly, it is freely available and open-source licensed under the Apache License 2.0. Moreover, it is conveniently implemented as a ‘pip’ install package and has been integrated with Google Colab[https://github.com/FrederikLizakJohansen/DebyeCalculatorGPU/blob/main/quickstart/QuickStart.ipynb], allowing users to rapidly calculate the Debye scattering equation without the need of local software installations. DebyeCalculator can be run on both CPU, GPU and through an interactive interface (see \autoref{fig:figure_2}), where users can calculate I(Q), S(Q), F(Q) and G(r) from structural models with one click.

![The interact mode of DebyeCalculator provides a one-click interface, where user can update parameters and visualise I(Q), S(Q), F(Q) and G(r). Additionally, the I(Q), S(Q), F(Q), G(r) and xyz-file can be downloaded, including metadata.\label{fig:figure2}](../figures/figure2.png)
![The interact mode of DebyeCalculator provides a one-click interface, where user can update parameters and visualise I(Q), S(Q), F(Q) and G(r). Additionally, the I(Q), S(Q), F(Q), G(r) and xyz-file can be downloaded, including metadata.\label{fig:figure_2}](../figures/figure_2.png)

# Acknowledgements

This work is part of a project that has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 Research and Innovation Programme (grant agreement No. 804066).

# Supporting Information

![Comparison of the calculated I(Q), SAXS, F(Q) and G(r) of DebyeCalculator and DiffPy-CMI[@juhas2015complex] on a synthetic crystallographic information file describing a CoO~2~ antifluorite crystal structure.[@CIF] Note that the scattering pattern simulated with DiffPy-CMI is hidden underneath the scattering pattern simulated with DebyeCalculator.\label{fig:FigureS1}](../figures/FigureS1.png)
![Comparison of the calculated I(Q), SAXS, F(Q) and G(r) of DebyeCalculator and DiffPy-CMI[@juhas2015complex] on a synthetic crystallographic information file describing a CoO~2~ antifluorite crystal structure.[@CIF] Note that the scattering pattern simulated with DiffPy-CMI is hidden underneath the scattering pattern simulated with DebyeCalculator.\label{fig:figure_S1}](../figures/figure_S1.png)

# References

0 comments on commit 3750996

Please sign in to comment.