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 FFTs #179

Open
5 of 7 tasks
matt-frey opened this issue Jun 27, 2023 · 5 comments
Open
5 of 7 tasks

Refactor FFTs #179

matt-frey opened this issue Jun 27, 2023 · 5 comments
Labels
feature request Used to label a feature request in the issue tracker.

Comments

@matt-frey
Copy link
Member

In GitLab by @vinciguerra_a on Jun 27, 2023, 14:45

Prior profiling has shown that memory allocations in CUDA are slow. The memory overhead was significantly reduced in !97, but the FFTs continue to create temporary views for heFFTe. These should instead be converted to member variables such that the memory can be reused. Only the dimensions are relevant, so the same view could be reused even for different input fields, as long as the dimensions match. This would drastically reduce time lost to cudaFree calls (on the order of 10ms per FFT transform).

There is a lot of repeated code across the FFT specializations. They should inherit from a common base class (templated on the FFT backend) to drastically reduce code duplication. The sine and cosine transformations share even more code and can be unified further than the other transformations.

The transformation directions should be replaced with enum constants to statically enforce their validity and provide semantic clarity.

  • Reuse temporary fields
  • Reduce code duplication
    • Common base functions for all FFTs
    • Common base class for sine and cosine transformations
    • Introduce additional utility functions in the base class (introduced in !192) for copying to temporary fields and performing the transformation
  • Replace ±1 literals for FFT transforms with enums
  • Reuse FFT object in solvers where possible
@matt-frey
Copy link
Member Author

In GitLab by @vinciguerra_a on Jul 7, 2023, 11:14

marked the task Reuse temporary fields as completed

@matt-frey
Copy link
Member Author

In GitLab by @vinciguerra_a on Jul 7, 2023, 11:14

marked the task Reduce code duplication as completed

@matt-frey
Copy link
Member Author

In GitLab by @vinciguerra_a on Jul 7, 2023, 11:14

marked the task Common base functions for all FFTs as completed

@matt-frey
Copy link
Member Author

In GitLab by @vinciguerra_a on Jul 14, 2023, 15:46

marked the task Replace ±1 literals for FFT transforms with enums as completed

@matt-frey
Copy link
Member Author

In GitLab by @vinciguerra_a on Jul 24, 2023, 07:54

marked the task Reuse FFT object in solvers where possible as completed

felixschurk pushed a commit that referenced this issue Dec 8, 2023
Resolve "Implement spectral Hessian"

Closes #179

See merge request OPAL/Libraries/ippl!191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Used to label a feature request in the issue tracker.
Projects
None yet
Development

No branches or pull requests

1 participant