Skip to content

Support acl bf16/fp16 gemm custom call#1143

Merged
Guo-Peilin merged 4 commits intomainfrom
support-acl-amp-gemm
Jun 8, 2023
Merged

Support acl bf16/fp16 gemm custom call#1143
Guo-Peilin merged 4 commits intomainfrom
support-acl-amp-gemm

Conversation

@Guo-Peilin
Copy link
Collaborator

No description provided.

@Guo-Peilin Guo-Peilin requested a review from qiuxiafei May 17, 2023 02:22
@qiuxiafei qiuxiafei requested a review from JamesTheZ May 17, 2023 03:33
Value rhs_f16 = rewriter.create<mhlo::ConvertOp>(loc, rhs, f16_ty);
RankedTensorType f16_tensor_ty =
RankedTensorType::getChecked(loc, result_ty.getShape(), f16_ty);
if (lhs_ty.getRank() != 2 || rhs_ty.getRank() != 2) return failure();

Choose a reason for hiding this comment

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

It seems only ACL bf16 kernel doesn't support higher rank? So we need to also check dtype here ?

FloatType f16_ty = FloatType::getF16(&ctx);
patterns.insert<ConvertDotGeneralOp>(&ctx, f16_ty);
}
if (enable_bf16_gemm_) {

Choose a reason for hiding this comment

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

should enable_bf16_gemm_ and enable_fp16_gemm_ be mutual exclusive?

@JamesTheZ
Copy link
Collaborator

Please add some UTs.

@Guo-Peilin Guo-Peilin force-pushed the support-acl-amp-gemm branch from d3399d9 to de6330f Compare May 18, 2023 03:17
@qiuxiafei
Copy link

Please add some UTs.

but ... passes are removed ... Orz ...

@Guo-Peilin Guo-Peilin force-pushed the support-acl-amp-gemm branch from 9f59419 to 610bdee Compare May 26, 2023 08:36
Copy link

@qiuxiafei qiuxiafei left a comment

Choose a reason for hiding this comment

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

As discussed, this will be tested after #1176 .

@Guo-Peilin Guo-Peilin merged commit 334d01b into main Jun 8, 2023
@Guo-Peilin Guo-Peilin deleted the support-acl-amp-gemm branch June 8, 2023 03:06
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

Comments