-
Notifications
You must be signed in to change notification settings - Fork 145
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
Prec param new #1813
base: jakpiase/ck_tile_gemm_api
Are you sure you want to change the base?
Prec param new #1813
Conversation
if(t.data_type == "fp16") | ||
{ | ||
return gemm_type_<GemmFp16>(t, args, s); | ||
} | ||
else if(t.data_type == "bf16") | ||
{ | ||
return gemm_type_<GemmBf16>(t, args, s); | ||
} | ||
else | ||
{ | ||
throw std::runtime_error("Wrong! Data type not supported!\n"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have also support for fp8. Take a look in here:
composable_kernel/include/ck_tile/ops/gemm/warp/warp_gemm.hpp
Lines 125 to 158 in 3de7bd6
using WarpGemmMfma_f32_32x32x16_fp8_fp8 = WarpGemmImpl< | |
WarpGemmAtrributeMfma<WarpGemmAttributeMfmaImpl_f32_32x32x16_fp8_fp8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_fp8_bf8 = WarpGemmImpl< | |
WarpGemmAtrributeMfma<WarpGemmAttributeMfmaImpl_f32_32x32x16_fp8_bf8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_bf8_fp8 = WarpGemmImpl< | |
WarpGemmAtrributeMfma<WarpGemmAttributeMfmaImpl_f32_32x32x16_bf8_fp8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_bf8_bf8 = WarpGemmImpl< | |
WarpGemmAtrributeMfma<WarpGemmAttributeMfmaImpl_f32_32x32x16_bf8_bf8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_fp8_fp8_CTransposed = | |
WarpGemmImpl<WarpGemmAtrributeMfmaTransposedCDistribution< | |
WarpGemmAttributeMfmaImpl_f32_32x32x16_fp8_fp8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_fp8_bf8_CTransposed = | |
WarpGemmImpl<WarpGemmAtrributeMfmaTransposedCDistribution< | |
WarpGemmAttributeMfmaImpl_f32_32x32x16_fp8_bf8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_bf8_fp8_CTransposed = | |
WarpGemmImpl<WarpGemmAtrributeMfmaTransposedCDistribution< | |
WarpGemmAttributeMfmaImpl_f32_32x32x16_bf8_fp8<WGAttrCtlEnum::Default_>>>; | |
using WarpGemmMfma_f32_32x32x16_bf8_bf8_CTransposed = | |
WarpGemmImpl<WarpGemmAtrributeMfmaTransposedCDistribution< | |
WarpGemmAttributeMfmaImpl_f32_32x32x16_bf8_bf8<WGAttrCtlEnum::Default_>>>; | |
template <index_t swizzle_factor = 2> | |
using WarpGemmMfmaFp8Fp8F32M32N32K16SwizzleBTransposedCDistribution = | |
WarpGemmImpl<WarpGemmAtrributeMfmaIterateKAndTransposedCDistribution_SwizzleB< | |
WarpGemmAttributeMfmaImpl_f32_32x32x16_f8_base<fp8_t, fp8_t, WGAttrCtlEnum::Default_>, | |
2, | |
swizzle_factor>>; |
struct GemmBf16 | ||
{ | ||
}; | ||
|
||
template <typename DataType> | ||
struct GemmBasicTypeConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this structure to GemmTypeConfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be renamed to gemm.hpp
- this is our GEMM host API definition.
struct GemmFp16 | ||
{ | ||
}; | ||
|
||
struct GemmBf16 | ||
{ | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about just enumerator class ?
template <typename DataType> | ||
struct GemmBasicTypeConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add documentation. Describe what this class defines ( supported data type configurations).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awkward. You repeat GemmBasicTypeConfig
in every function... Why not just pass type string and layouts as strings ? We should manage this inside our host API and do not repeat the same logic at every step.
Proposed changes
Please describe the motivation behind the pull request, whether it enables a new feature or fixes a bug. If there are associated pull requests or issues, please link them to the pull request.
Checklist
Please put an
x
into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.clang-format
on all changed filesDiscussion
If this is a relatively large or complex change, feel free to start a discussion by explaining why you chose the solution you did and what alternatives you considered