NVIDIA / NVIDIA/cccl

[FEA]: Add support for new extended floating point types

Open
#3,558 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Is this a duplicate?

- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this request and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Area

libcu++

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

CUDA 12.8 introduced several new extended floating point types:
* NVFP4
* `__nv_fp4_e2m2`
* This data format is a 4-bit floating point format with 2 bits for exponent and 1 bit for mantissa. The e2m1 encoding does not support infinity and `NaN`.
* NVFP6
* `__nv_fp6_e2m3`
* This data format is a 6-bit floating point format with 2 bits for exponent and 3 bits for mantissa. The e2m3 encoding does not support infinity and `NaN`.
* `__nv_fp6_e3m2`
* This data format is a 6-bit floating point format with 3 bits for exponent and 2 bits for mantissa. The e3m2 encoding does not support infinity and `NaN`.
* NVFP8
* `__nv_fp8_e8m0`
* This data format is an 8-bit unsigned floating-point format with 8 bits for exponent and 0 bits for mantissa. The ue8m0 encoding does not support infinity. `NaN` value is limited to `0xff`.

### Describe the solution you'd like

* [x] Add feature macros for NVFP4 and NVFP6 types, similar to NVFP8
* [x] Specialize `cuda::std::numeric_limits` for these types
* [ ] Implement overloads in ``
* [ ] Implement specializations of `cuda::std::complex`

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.