Skip to content

Conversation

yhmtsai
Copy link
Member

@yhmtsai yhmtsai commented Apr 15, 2025

This PR allow to enable bfloat16 and half precision at the same time.
Doing the operation between bfloat16 and half precision returns float type.
It will revert the gko::float16 alias changes in #1825 . float16 will be half precision again.
Moreover, it adds the next_precision_move<type, move> to represent the next_precision<next_precision<.... same for previous_precision_move

likely in another PR:

  • convert_to are just copy the same implementation for different interface. create a templated convert_to in private: and convert_to always call the templated function
  • instantiation macro, which we might apply the same technique as what I did in batch to use nested structure
  • allow run<> to accepts type_list and create a list for that

@yhmtsai yhmtsai added this to the Ginkgo 1.10.0 milestone Apr 15, 2025
@yhmtsai yhmtsai requested a review from a team April 15, 2025 11:17
@yhmtsai yhmtsai self-assigned this Apr 15, 2025
@ginkgo-bot ginkgo-bot added reg:build This is related to the build system. reg:testing This is related to testing. type:solver This is related to the solvers type:preconditioner This is related to the preconditioners type:matrix-format This is related to the Matrix formats type:reordering This is related to the matrix(LinOp) reordering mod:all This touches all Ginkgo modules. labels Apr 15, 2025
@yhmtsai yhmtsai force-pushed the enable_half_bfloat16 branch from 2bfb6ac to 307e9e4 Compare April 16, 2025 11:51
Copy link
Member

@MarcelKoch MarcelKoch left a comment

Choose a reason for hiding this comment

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

Some first notes, I still have to finish the rest of the PR. However, I think these are already the most relevant comments.

Copy link
Member

@MarcelKoch MarcelKoch left a comment

Choose a reason for hiding this comment

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

Looks mostly good. My comment on the ConvertibleTo stuff can be ignored for this PR.

@yhmtsai yhmtsai force-pushed the enable_half_bfloat16 branch from 4f0036b to 0c30ad2 Compare May 2, 2025 13:59
@yhmtsai yhmtsai force-pushed the enable_half_bfloat16 branch from 0c30ad2 to cc194b7 Compare May 2, 2025 14:08
@yhmtsai yhmtsai force-pushed the enable_half_bfloat16 branch from cc194b7 to 9278719 Compare May 2, 2025 17:04
@MarcelKoch MarcelKoch mentioned this pull request May 6, 2025
@yhmtsai yhmtsai force-pushed the add_bfloat16 branch 2 times, most recently from cf681ad to 29df96b Compare May 6, 2025 10:07
@yhmtsai yhmtsai added the 1:ST:ready-to-merge This PR is ready to merge. label May 6, 2025
Base automatically changed from add_bfloat16 to develop May 6, 2025 20:16
@yhmtsai yhmtsai force-pushed the enable_half_bfloat16 branch 7 times, most recently from 7c3e451 to 83549e3 Compare May 7, 2025 09:57
@yhmtsai yhmtsai force-pushed the enable_half_bfloat16 branch from 83549e3 to 22e11ec Compare May 7, 2025 12:07
@yhmtsai yhmtsai merged commit cf59272 into develop May 7, 2025
12 of 16 checks passed
@yhmtsai yhmtsai deleted the enable_half_bfloat16 branch May 7, 2025 18:01
@ginkgo-bot
Copy link
Member

Error: PR already merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1:ST:ready-to-merge This PR is ready to merge. mod:all This touches all Ginkgo modules. reg:build This is related to the build system. reg:testing This is related to testing. type:matrix-format This is related to the Matrix formats type:preconditioner This is related to the preconditioners type:reordering This is related to the matrix(LinOp) reordering type:solver This is related to the solvers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants