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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
64ee98c
Refactor: use less memory to calculate stress in pw base
Apr 23, 2024
faac19f
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Apr 23, 2024
dfc9b0f
Fix: nondiagonal matrix element in PW-Stress calculation
Apr 23, 2024
12b407f
Fix: uspp stress calculation
Apr 23, 2024
260bc30
Merge branch 'develop' into pw_stress
mohanchen Apr 27, 2024
75f01cc
Merge branch 'develop' into pw_stress
mohanchen May 4, 2024
ccfd2f1
Merge branch 'develop' into pw_stress
mohanchen May 5, 2024
4114e85
Merge branch 'develop' into pw_stress
mohanchen May 5, 2024
2eecc2b
add gemm_op in gpu and add vkb_op
grysgreat May 6, 2024
89a9ce9
delete comment
grysgreat May 6, 2024
bb7ea83
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
May 6, 2024
05d59b4
delete comment2
grysgreat May 6, 2024
d7d2782
Merge branch 'pw_stress' of github.com:grysgreat/abacus-develop into …
May 6, 2024
cb63316
Fix: error in merging
May 6, 2024
95eef5f
update ops.
grysgreat May 7, 2024
158cfa2
add correct vq.
grysgreat May 9, 2024
2072611
finish stress ops!
grysgreat May 10, 2024
8bda34e
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
May 11, 2024
cd17539
Merge branch 'pw_stress' of github.com:grysgreat/abacus-develop into …
May 11, 2024
f294913
Merge branch 'develop' into pw_stress
mohanchen May 11, 2024
d9bf4e4
Fix: compiling error
May 11, 2024
7a13d7d
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
May 11, 2024
971f539
Refactor: delete GlobalC used in stress_nl code
May 13, 2024
144496d
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
May 13, 2024
c2be080
Fix: compiling error in CUDA
May 13, 2024
1db1b36
Fix: DCU error in synchronize_ptrs
May 13, 2024
9e9d748
Fix: GlobalC in Sto_stress_PW
May 13, 2024
7e848b4
Merge branch 'develop' into pw_stress
WHUweiqingzhou May 14, 2024
2f658f2
add new stress and force in high speed.
grysgreat Jun 4, 2024
929b9f8
delete time prints.
grysgreat Jun 4, 2024
c0757cb
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 4, 2024
ea2c84e
Fix: compiling error from merge
Jun 4, 2024
1e9938f
Fix: compiling error from merge on GPU
Jun 4, 2024
719945a
remove some if(GPU)
grysgreat Jun 5, 2024
49b0c9a
finish force remove gpus.
grysgreat Jun 5, 2024
25e7302
Memory: reduce memory allocation for hpsi and spsi in diagH_subspace_…
Religious-J Jun 6, 2024
97e49d0
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 7, 2024
a22c4c3
fix: compiler error
Jun 7, 2024
d0e8b7b
Merge branch 'diagH_GPU' of github.com:Religious-J/abacus-develop int…
Jun 7, 2024
b33a790
Merge branch 'pw_stress_dev' of github.com:grysgreat/abacus-develop i…
Jun 7, 2024
6d19e65
Memory: reduce memory allocation for hpsi and spsi in diagH_subspace_…
Religious-J Jun 7, 2024
d0d0f8c
Memory: reduce memory allocation for hpsi and spsi in diagH_subspace_…
Religious-J Jun 7, 2024
324c7c7
Fix: force calculation error
Jun 7, 2024
7bef0cd
Merge branch 'diagH_GPU' of github.com:Religious-J/abacus-develop int…
Jun 7, 2024
830de64
Fix: error of Lcao_in_PW
Jun 7, 2024
6b1a778
Fix: error in GPU
Jun 7, 2024
37b33b6
Fix: force error
Jun 11, 2024
73f0772
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 11, 2024
b15143a
Try: use one temp psi for cg
Jun 11, 2024
00518b3
fix: error in cg
Jun 11, 2024
cd03b76
Fix: sdft error
Jun 11, 2024
936694d
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 14, 2024
fa633de
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 17, 2024
ce1a882
fix: compiling error
Jun 17, 2024
c882b96
Refactor: new class tool for pw_stress code
Jun 18, 2024
11a7fc1
fix: memory leak in stress
dyzheng Jun 18, 2024
cd4be7b
Refactor: force calculation for pw code
Jun 18, 2024
8e732f2
Fix: force error
Jun 19, 2024
b846238
delete useless code of old force
Jun 19, 2024
66939c0
fix: compiling error on GPU/DCU
Jun 19, 2024
e3668bd
Fix: error on GPU
Jun 19, 2024
5f23be5
Fix: uninitialize error on force
Jun 19, 2024
34e379c
Fix: Makefile.objects
Jun 19, 2024
8e53908
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 19, 2024
f70a596
update dylmr2
Jun 19, 2024
d5db19a
Fix: compiling error
Jun 19, 2024
57a0bab
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 19, 2024
ebce7bb
Fix: force performance
Jun 21, 2024
b30c060
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
Jun 21, 2024
d82183b
Fix: error in cuda
Jun 21, 2024
c007b64
Fix: compiling error in cuda
Jun 21, 2024
faa52c1
Fix: compiling error in cuda
Jun 21, 2024
0cb0a81
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 21, 2024
08fbd79
Fix: compiling error in CUDA
Jun 24, 2024
d62acca
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
Jun 24, 2024
b3e2235
Fix: compiling error in CUDA/ROCM
Jun 24, 2024
4d0e3cb
Fix: stress error
Jun 24, 2024
bee30e3
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 24, 2024
554ac55
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 24, 2024
0286f97
update from PR comments
Jun 24, 2024
c0b4af3
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
Jun 24, 2024
39fc340
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 24, 2024
3bd49a0
add timer and optimize stress
Jun 25, 2024
e517bc5
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
Jun 25, 2024
3a462cd
fix: g_plus_k
Jun 25, 2024
23a51c2
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 25, 2024
40970c4
Fix: delete pointers
Jun 25, 2024
6d0ba33
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
Jun 25, 2024
6c5227d
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 25, 2024
416d777
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 25, 2024
8ac8581
Fix: stress time
Jun 25, 2024
a4f9d7e
Merge branch 'pw_stress' of github.com:dyzheng/abacus-develop into pw…
Jun 25, 2024
0c12b34
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 25, 2024
190d606
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into…
Jun 26, 2024
57626b8
fix: add annotations
Jun 26, 2024
23323dc
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jun 26, 2024
aee85ba
Merge branch 'develop' into pw_stress
mohanchen Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ OBJS_SRCPW=H_Ewald_pw.o\
fp_energy.o\
forces.o\
forces_us.o\
forces_nl.o\
fs_nonlocal_tools.o\
force_op.o\
stress_op.o\
wf_op.o\
Expand Down
4 changes: 4 additions & 0 deletions source/module_base/module_device/cuda/memory_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ template struct delete_memory_op<float, base_device::DEVICE_GPU>;
template struct delete_memory_op<double, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<float>, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<double>, base_device::DEVICE_GPU>;
template struct delete_memory_op<float*, base_device::DEVICE_GPU>;
template struct delete_memory_op<double*, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<float>*, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<double>*, base_device::DEVICE_GPU>;

} // namespace memory
} // end of namespace base_device
5 changes: 4 additions & 1 deletion source/module_base/module_device/memory_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ template struct delete_memory_op<float, base_device::DEVICE_CPU>;
template struct delete_memory_op<double, base_device::DEVICE_CPU>;
template struct delete_memory_op<std::complex<float>, base_device::DEVICE_CPU>;
template struct delete_memory_op<std::complex<double>, base_device::DEVICE_CPU>;
template struct delete_memory_op<float*, base_device::DEVICE_CPU>;
template struct delete_memory_op<double*, base_device::DEVICE_CPU>;
template struct delete_memory_op<std::complex<float>*, base_device::DEVICE_CPU>;
template struct delete_memory_op<std::complex<double>*, base_device::DEVICE_CPU>;

#if !(defined(__CUDA) || defined(__ROCM))


template <typename FPTYPE>
struct resize_memory_op<FPTYPE, base_device::DEVICE_GPU>
{
Expand Down
4 changes: 4 additions & 0 deletions source/module_base/module_device/rocm/memory_op.hip.cu
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ template struct delete_memory_op<float, base_device::DEVICE_GPU>;
template struct delete_memory_op<double, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<float>, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<double>, base_device::DEVICE_GPU>;
template struct delete_memory_op<float*, base_device::DEVICE_GPU>;
template struct delete_memory_op<double*, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<float>*, base_device::DEVICE_GPU>;
template struct delete_memory_op<std::complex<double>*, base_device::DEVICE_GPU>;

} // namespace memory
} // end of namespace base_device
1 change: 1 addition & 0 deletions source/module_esolver/esolver_ks_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ void ESolver_KS_PW<T, Device>::cal_stress(ModuleBase::matrix& stress)
}
ss.cal_stress(stress,
GlobalC::ucell,
&GlobalC::ppcell,
this->pw_rhod,
&GlobalC::ucell.symm,
&this->sf,
Expand Down
4 changes: 3 additions & 1 deletion source/module_esolver/esolver_sdft_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ void ESolver_SDFT_PW::cal_stress(ModuleBase::matrix& stress)
pw_wfc,
this->psi,
this->stowf,
pelec->charge);
pelec->charge,
&GlobalC::ppcell,
GlobalC::ucell);
}

void ESolver_SDFT_PW::after_all_runners()
Expand Down
2 changes: 2 additions & 0 deletions source/module_hamilt_pw/hamilt_pwdft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ list(APPEND objects
operator_pw/meta_pw.cpp
operator_pw/velocity_pw.cpp
operator_pw/operator_pw.cpp
forces_nl.cpp
forces.cpp
forces_us.cpp
stress_func_cc.cpp
Expand All @@ -32,6 +33,7 @@ list(APPEND objects
global.cpp
parallel_grid.cpp
elecond.cpp
fs_nonlocal_tools.cpp
)

add_library(
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_pw/hamilt_pwdft/VNL_in_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ void pseudopot_cell_vnl::getvnl(Device* ctx, const int& ik, std::complex<FPTYPE>
npw,
this->wfcpw->npwk_max,
this->nhm,
GlobalV::NQX,
this->tab.getBound2(),
this->tab.getBound3(),
atom_na,
Expand Down
Loading
Loading