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 support for running entirely in single precision #666

Open
BenWibking opened this issue Jul 1, 2024 · 2 comments
Open

add support for running entirely in single precision #666

BenWibking opened this issue Jul 1, 2024 · 2 comments
Labels
enhancement New feature or request floating-point issue with floating-point roundoff error

Comments

@BenWibking
Copy link
Collaborator

BenWibking commented Jul 1, 2024

Describe the proposal
Support running amrex::Real as float (compile with -DAMReX_PRECISION=SINGLE) and replace all uses of double with amrex::Real. Ensure that all tests still pass.

Describe alternatives you've considered
We have so far relied on users running on GPUs with hardware support for double precision arithmetic.

Additional context
Due to AI, future-generation GPUs may completely drop hardware support for double precision arithmetic.

@BenWibking BenWibking added enhancement New feature or request floating-point issue with floating-point roundoff error labels Jul 1, 2024
@chongchonghe
Copy link
Contributor

I totally agree and support this plan. I recently learned about another code under development that uses mixed precision and achieves extremely high speed, about 100 Mupdates/s/GPU on game cards (RTX 3080/3090). They use single precision for the approximate Riemann solver but use double precision in the conservation step.

@BenWibking
Copy link
Collaborator Author

BenWibking commented Jul 1, 2024

That's interesting.

Over the next couple of years, the code needs to run without double precision at all. If we need extra precision, we can do Kahan summation or represent numbers as the sum of two single precision values (then overload arithmetic operators such as + and * to emulate double precision).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request floating-point issue with floating-point roundoff error
Projects
None yet
Development

No branches or pull requests

2 participants