-
Notifications
You must be signed in to change notification settings - Fork 139
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
First stage of add DSP FFT #5878
base: develop
Are you sure you want to change the base?
Conversation
@@ -65,6 +67,12 @@ void FFT_Bundle::initfft(int nx_in, | |||
|
|||
if (device=="cpu") | |||
{ | |||
#if defined(__DSP) | |||
if (float_flag==true) | |||
ModuleBase::WARNING_QUT("device","now dsp fft is not support for the float type"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support -> supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add {} for if (float_flag==true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine
PLAN* ptr_plan_forward; | ||
PLAN* ptr_plan_backward; | ||
INT num_thread=8; | ||
INT size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize the variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine
@@ -22,6 +22,9 @@ PW_Basis_K::~PW_Basis_K() | |||
delete[] igl2isz_k; | |||
delete[] igl2ig_k; | |||
delete[] gk2; | |||
#if defined(__DSP) | |||
delete[] ig2ixyz_k_cpu; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's dangeruous to use delte[] with #if, cold you change ig2ixyz_k_cpu to std::vector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly, I shall make the necessary amendments to it.
ACHIEVEMENT
When compiling ABACUS with the DSP=ON option, the software automatically configures the FFT device to utilize DSP. This configuration demonstrates significant performance improvements, achieving over 30 times the speed compared to the FT cluster. Additionally, it exhibits strong scalability.I would like to acknowledge the contributions of the author of the mt_3d_fft library and extend my gratitude to @Qianruipku for their valuable input. Special thanks are also due to @mohanchen for significant support .Due to the check of the compuer ,i temporarially add the first stage of the DSP FFT.
Attention
1.FUNCTION:This is not the final step in porting DSP computations. After specifying MT_FFT_LIBRARY, MT_FFT_INCLUDE, and MT_HRHREAD, the DSP can be utilized to compute FFT. Currently, simultaneous use of DSP FFT and BLAS is not supported. Features for this will be promptly added.

2.PERFOMANCE: At present, the DSP FFT does not achieve its fastest performance, as some memory copies have not yet been optimized. This aspect will also be optimized in the future.Some functions in real_to_recip do not utilize memcpy or zapy_. These functions could be optimized or potentially moved to the DSP for improved performance.
What's changed?