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

Enable GEMM/dot for FP8 using hipblasLT #3577

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/targets/gpu/hip_gemm_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
case shape::int32_type: return HIP_R_32I;
case shape::uint32_type: return HIP_R_32U;
case shape::fp8e4m3fnuz_type: return HIP_R_8F_E4M3_FNUZ;
case shape::fp8e4m3fn_type:
case shape::fp8e5m2_type:
case shape::fp8e4m3fn_type: return HIP_R_8F_E4M3;

Check warning on line 73 in src/targets/gpu/hip_gemm_impl.cpp

View workflow job for this annotation

GitHub Actions / tidy

switch has 2 consecutive identical branches [bugprone-branch-clone,-warnings-as-errors]

Check warning on line 73 in src/targets/gpu/hip_gemm_impl.cpp

View workflow job for this annotation

GitHub Actions / tidy

use of undeclared identifier 'HIP_R_8F_E4M3' [clang-diagnostic-error]
case shape::fp8e5m2_type: return HIP_R_8F_E5M2;

Check warning on line 74 in src/targets/gpu/hip_gemm_impl.cpp

View workflow job for this annotation

GitHub Actions / tidy

use of undeclared identifier 'HIP_R_8F_E5M2' [clang-diagnostic-error]
case shape::tuple_type:
case shape::bool_type:
case shape::uint16_type:
Expand Down
4 changes: 3 additions & 1 deletion src/targets/gpu/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@
unsupported_fp8e4m3fnuz_ops.insert("argmin");

std::set<std::string> unsupported_fp8ocp_ops = {};
// TODO update with hipBLASLt support
// TODO: remove this when the flag is removed
#if !MIGRAPHX_ENABLE_HIPBLASLT_GEMM

Check warning on line 133 in src/targets/gpu/target.cpp

View workflow job for this annotation

GitHub Actions / tidy

'MIGRAPHX_ENABLE_HIPBLASLT_GEMM' is not defined, evaluates to 0 [clang-diagnostic-undef,-warnings-as-errors]
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need to do MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_HIPBLASLT_GEMM) at the top of the file...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what that does exactly. Is the env variable not declared elsewhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be the way MIGraphX handles env vars. Doing this provides functions like enabled/disabled etc to work with the env vars, so we can set any of the following values for the env variable:

Set to "1", "enable", "enabled", "yes", or "true" to use.

Also, I missed to mention that we should do if(not enabled(MIGRAPHX_ENABLE_HIPBLASLT_GEMM{})) instead of !MIGRAPHX_ENABLE_HIPBLASLT_GEMM, for guarding using the env variable.

unsupported_fp8ocp_ops.insert("dot");
unsupported_fp8ocp_ops.insert("quant_dot");
#endif
#if MIGRAPHX_USE_MIOPEN
// MIOpen doesn't have support for fp8 pooling yet.
unsupported_fp8ocp_ops.insert("pooling");
Expand Down
Loading