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

First stage of add DSP FFT #5878

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft

First stage of add DSP FFT #5878

wants to merge 7 commits into from

Conversation

A-006
Copy link
Collaborator

@A-006 A-006 commented Jan 23, 2025

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?

  • Implement DSP FFT functionality within the fft_base class.
  • Add the control flow in the fft_bundle
  • Update the CMakeLists.txt configuration to enable compilation of the DSP FFT library.

@@ -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");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support -> supported

Copy link
Collaborator

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)

Copy link
Collaborator Author

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialize the variable

Copy link
Collaborator Author

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;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@mohanchen mohanchen added GPU & DCU & HPC GPU and DCU and HPC related any issues Features Needed The features are indeed needed, and developers should have sophisticated knowledge labels Jan 26, 2025
@A-006 A-006 marked this pull request as draft February 13, 2025 13:48
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 GPU & DCU & HPC GPU and DCU and HPC related any issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants