Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

More fast math #3337

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

Merged
merged 2 commits into from
Nov 26, 2022
Merged

More fast math #3337

merged 2 commits into from
Nov 26, 2022

Conversation

umar456
Copy link
Member

@umar456 umar456 commented Nov 25, 2022

Fix tests and improve the AF_WITH_FAST_MATH option in OpenCL and CUDA

Description

  • Pass fast math flag to nvcc
  • Pass fast math flag to nvrtc
  • Pass fast math flag to OpenCL
  • Fix min and max function when AF_WITH_FAST_MATH is set because infinity doesn't exist with fast math
  • Set cuBLAS math mode to CUBLAS_TF32_TENSOR_OP_MATH when AF_WITH_FAST_MATH is set

Changes to Users

N/A

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

Copy link
Member

@9prady9 9prady9 left a comment

Choose a reason for hiding this comment

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

do we have any fast mode specific tests ?

@umar456
Copy link
Member Author

umar456 commented Nov 26, 2022

We don't have fast math specific tests. I am not sure how we could write one. We can lower precision but I don't think that will be helpful. A lot of tests still fail with these changes. I am not sure if we can fix all of them.

@umar456 umar456 merged commit 2181739 into arrayfire:master Nov 26, 2022
@umar456 umar456 deleted the more_fast_math branch November 26, 2022 18:23
@WilliamTambellini
Copy link
Contributor

Perhaps you could add some fastmath specific refs values using the macro :
https://stackoverflow.com/questions/43140581/how-to-use-the-gcc-preprocessor-macro-fast-math
But what I ve seen is that results with fastmath depend on many vars (os, cpu arch, compiler, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.