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

Provide the most important <cmath> functions for __half/bfloat16 #3410

Closed
1 task done
fbusato opened this issue Jan 15, 2025 · 8 comments
Closed
1 task done

Provide the most important <cmath> functions for __half/bfloat16 #3410

fbusato opened this issue Jan 15, 2025 · 8 comments
Labels
feature request New feature or request.

Comments

@fbusato
Copy link
Contributor

fbusato commented Jan 15, 2025

Is this a duplicate?

Area

libcu++

Is your feature request related to a problem? Please describe.

<cmath> is widely used to interact with floating-point types, but libcu++ doesn't provide support for __half/bfloat16/fp8

Describe the solution you'd like

Provide at least the following functions:

  • isfinite
  • isinf
  • isnan
  • isnormal
  • signbit

Describe alternatives you've considered

No response

Additional context

No response

@fbusato fbusato added the feature request New feature or request. label Jan 15, 2025
@github-project-automation github-project-automation bot moved this to Todo in CCCL Jan 15, 2025
@miscco
Copy link
Collaborator

miscco commented Jan 15, 2025

@miscco miscco closed this as completed Jan 15, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in CCCL Jan 15, 2025
@fbusato
Copy link
Contributor Author

fbusato commented Jan 15, 2025

I don't see any documentation related to <cmath>

@miscco
Copy link
Collaborator

miscco commented Jan 15, 2025

We should add that

@bernhardmgruber
Copy link
Contributor

Where is the functionality for FP8 types? I don't find it.

@miscco
Copy link
Collaborator

miscco commented Jan 21, 2025

I believe we wanted to split this up, because there is currently no support for FP8 in libcu++ whereas support for the 16 bit types is effectively done

@bernhardmgruber bernhardmgruber changed the title Provide the most important <cmath> functions for __half/bfloat16/fp8 Provide the most important <cmath> functions for __half/bfloat16 Jan 21, 2025
@bernhardmgruber
Copy link
Contributor

ok, I fixed the issue title then.

@fbusato
Copy link
Contributor Author

fbusato commented Jan 21, 2025

FP8 in CUDA is more a placeholder for exploiting tensor cores. It is not a really general type as bfloat or half. I don't think we need to support common math operation over FP8.

@bernhardmgruber
Copy link
Contributor

FP8 in CUDA is more a placeholder for exploiting tensor cores. It is not a really general type as bfloat or half. I don't think we need to support common math operation over FP8.

We have ugly hacks in our unit tests that specialize [cuda::]::std::numeric_limits for those types, so we already use that functionality today.

AFAIK, we don't need <cmath> for FP8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request.
Projects
Status: Done
Development

No branches or pull requests

3 participants