Skip to content

[Unity][CUTLASS] Support out_dtype = "float32" for FasterTransformer kernel - #15377

Merged
Hzfengsy merged 1 commit into
apache:unityfrom
masahi:ft-out-fp32
Jul 21, 2023
Merged

[Unity][CUTLASS] Support out_dtype = "float32" for FasterTransformer kernel#15377
Hzfengsy merged 1 commit into
apache:unityfrom
masahi:ft-out-fp32

Conversation

@masahi

@masahi masahi commented Jul 21, 2023

Copy link
Copy Markdown
Member

The FT kernel requires the output pointer type to be fp16, so we haven't supported offloading matmul with out_dtype="float32". But if such matmul is immediately followed by a cast to fp16, we can match and replace the whole matmul -> cast with the FT kernel.

Such case arises if a user wants to do fp32 accum during matmul. It turns out the FT kernel always does fp32 accumulation internally regardless of the output dtype, so we are not losing any precision by offloading matmul(..., out_dtype = "float32") -> cast to the fp16 A - int B FT kernel.

@vinx13 @sunggg @yzh119

@tvm-bot

tvm-bot commented Jul 21, 2023

Copy link
Copy Markdown
Collaborator

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Hzfengsy
Hzfengsy merged commit e38eb90 into apache:unity Jul 21, 2023
junrushao pushed a commit to junrushao/tvm that referenced this pull request Jul 24, 2023
…r kernel (apache#15377)

Support out_dtype = "float32" for FasterTransformer kernel
junrushao pushed a commit to junrushao/tvm that referenced this pull request Jul 27, 2023
…r kernel (apache#15377)

Support out_dtype = "float32" for FasterTransformer kernel
junrushao pushed a commit to junrushao/tvm that referenced this pull request Jul 30, 2023
…r kernel (apache#15377)

Support out_dtype = "float32" for FasterTransformer kernel
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