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

Support FP8 in radix sort #623

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

gevtushenko
Copy link
Collaborator

@gevtushenko gevtushenko commented Oct 26, 2023

Description

closes #617
closes #590

This PR:

  1. introduces FP8 (__nv_fp8_e4m3 and __nv_fp8_e5m2) support for CUB radix sort
  2. fixes block radix sort tests to work correctly in the presence of negative FP values
  3. fixes default min / max generator values to be lowest / max
  4. fixes c2h generator to correctly handle lowest / max value range

Some of the tests do not work correctly with the lowest / max FP range. These are mostly tests that accumulate values. When significant number of large values (1^38) is accumulated, we push floats to inf values, that complicates comparison. For now, I've reduced the value range for these tests to get them passing. We should think how to handle FP tests going forward.

The PR doesn't update CUB docs to guarantee fp8 support. I suggest the following order:

  1. device radix sort test is ported to Catch2
  2. device radix sort test covers fp8
  3. documentation is updated to guarantee fp8 support

We should also document __nv_bfloat16. For some reason, only __half is documented right now.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@gevtushenko gevtushenko requested review from a team as code owners October 26, 2023 00:49
@gevtushenko gevtushenko requested review from elstehle, ericniebler and alliepiper and removed request for a team October 26, 2023 00:49
cub/cub/util_type.cuh Show resolved Hide resolved
cub/test/catch2_test_block_radix_sort.cuh Show resolved Hide resolved
cub/test/catch2_test_block_reduce.cu Show resolved Hide resolved
@gevtushenko gevtushenko requested a review from a team as a code owner October 27, 2023 00:08
@copy-pr-bot
Copy link

copy-pr-bot bot commented Oct 27, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@gevtushenko
Copy link
Collaborator Author

/ok to test

@gevtushenko
Copy link
Collaborator Author

/ok to test

@jrhemstad jrhemstad merged commit 142c1d5 into NVIDIA:main Oct 30, 2023
509 of 511 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
4 participants