Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: use less memory and optimize performance to calculate force and stress in pw base #4047

Merged
merged 97 commits into from
Jun 27, 2024

Conversation

dyzheng
Copy link
Collaborator

@dyzheng dyzheng commented Apr 23, 2024

I have refactored stress code structure in this PR.
In case Mg16Al16, the memory cost of stress calculation from 16752 MB to 194 MB.

Linked Issue

Close #3714
Close #4158
Close #3710
Close #4026
Close #3931
Close #4031

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

@Qianruipku
Copy link
Collaborator

Has the efficiency of the new algorithm been tested? Are there any test data available?

@dyzheng
Copy link
Collaborator Author

dyzheng commented Apr 24, 2024

Has the efficiency of the new algorithm been tested? Are there any test data available?

I have not tested many cases, in Mg16Al16 case , time of stress_nl change from 94 s to 124 s, I think the performance of new method still can be improved.

@Qianruipku
Copy link
Collaborator

Perhaps the QE code can be used as a reference.

source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
source/module_hamilt_pw/hamilt_pwdft/stress_func_nl.cpp Outdated Show resolved Hide resolved
@dyzheng
Copy link
Collaborator Author

dyzheng commented May 6, 2024

I will work with @grysgreat to accelerate performance in GPU/DCU, change this PR to draft.

@dyzheng dyzheng marked this pull request as draft May 6, 2024 05:02
@mohanchen
Copy link
Collaborator

mohanchen commented Jun 26, 2024

two general comments. 1) lack of doxygen-style notes or explanations. 2) both CPU and GPU codes, especially for the GPU codes, are not well-written in terms of high-performance computing (but this can be improved in future)

@dyzheng dyzheng changed the title Refactor: use less memory to calculate stress in pw base Refactor: use less memory and optimize performance to calculate force and stress in pw base Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Features Needed The features are indeed needed, and developers should have sophisticated knowledge
Projects
None yet
8 participants