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

Add templates for recip_to_real in the pw_basis #6023

Merged
merged 10 commits into from
Mar 25, 2025

Conversation

A-006
Copy link
Collaborator

@A-006 A-006 commented Mar 19, 2025

What's changed?

  • Currently, pw_basis utilizes the recip_to_real function directly, which does not support multi-device environments. To address this, I have added function templates to enable multi-device usage.
  • Given that real2recip and recip2real are widely used throughout the program, transitioning to a multi-device setup requires specifying the context (ctx) for each. This change necessitates modifications in over 50 places within the program, most of which will require passing additional parameters. To simplify this transition, we have set the default context as CPU.
  • For GPU and DCU functions of real_to_recip, it is necessary to pass pointers allocated in video memory (GPU). Therefore, memory allocation on the GPU must precede its use. Currently, rho is allocated on the CPU; hence, while we will add GPU functions, they will not be utilized until rho is also moved to GPU memory.

@A-006 A-006 marked this pull request as draft March 19, 2025 02:12
@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Mar 19, 2025
@A-006 A-006 marked this pull request as ready for review March 23, 2025 13:52
@mohanchen mohanchen requested a review from Qianruipku March 24, 2025 01:18
@mohanchen mohanchen merged commit 2610f1e into deepmodeling:develop Mar 25, 2025
14 checks passed
@mohanchen mohanchen added the Features Needed The features are indeed needed, and developers should have sophisticated knowledge label Mar 25, 2025
Fisherd99 pushed a commit to Fisherd99/abacus-BSE that referenced this pull request Mar 31, 2025
* update recip_to_real in the rhpw

* add the operator in pw_basis

* remove ctx in the file

* remove ctx in bundle

* update compile bug

* add T,device

* moidfy back the func

* update func
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 Refactor Refactor ABACUS codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants