Skip to content

Commit

Permalink
Change name of env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsan-ca committed Feb 5, 2025
1 parent 04a7b6e commit c3b42d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ rocm_enable_cppcheck(
${CMAKE_CURRENT_SOURCE_DIR}/test/include
DEFINE
MIGRAPHX_MLIR=1
MIGRAPHX_ENABLE_HIPBLASLT_GEMM=1
MIGRAPHX_HAS_EXECUTORS=0
CPPCHECK=1
MIGRAPHX_USE_MIOPEN=1
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/env_vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ Use it in conjunction with ``MIGRAPHX_DISABLE_MLIR=1``.
Set to "1", "enable", "enabled", "yes", or "true" to use.
Disables use of the rocMLIR library.

.. envvar:: MIGRAPHX_ENABLE_HIPBLASLT_GEMM
Set to "0", "disable", "disabled", "no", or "false" to use.
.. envvar:: MIGRAPHX_DISABLE_HIPBLASLT_GEMM
Set to "1", "enable", "enabled", "yes", or "true" to use.
Disables use of hipBLASLt.

.. envvar:: MIGRAPHX_COPY_LITERALS
Expand Down
1 change: 0 additions & 1 deletion src/targets/gpu/fuse_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {

MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_HIPBLASLT_GEMM)
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_DISABLE_MIOPEN_FUSION)
#if MIGRAPHX_USE_MIOPEN
struct fusion
Expand Down
4 changes: 2 additions & 2 deletions src/targets/gpu/lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
namespace gpu {

MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_HIPBLASLT_GEMM);
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_DISABLE_HIPBLASLT_GEMM);
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_DISABLE_MIOPEN_POOLING)

struct miopen_apply
Expand Down Expand Up @@ -254,7 +254,7 @@ struct miopen_apply
auto output = insert_allocation(ins, ins->get_shape());
refs.push_back(output);
#if MIGRAPHX_USE_HIPBLASLT
if(disabled(MIGRAPHX_ENABLE_HIPBLASLT_GEMM{}) or not hipblaslt_supported())
if(enabled(MIGRAPHX_DISABLE_HIPBLASLT_GEMM{}) or not hipblaslt_supported())
{
#endif
return mod->replace_instruction(
Expand Down
13 changes: 4 additions & 9 deletions src/targets/gpu/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_NHWC)
#ifndef _WIN32
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_CK)
#endif
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_ENABLE_HIPBLASLT_GEMM)
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_DISABLE_HIPBLASLT_GEMM)

std::vector<pass> target::get_passes(migraphx::context& gctx, const compile_options& options) const
{
Expand All @@ -107,7 +107,7 @@ std::vector<pass> target::get_passes(migraphx::context& gctx, const compile_opti
// different between fp8e4m3fnuz and OCP types because rocBLAS only has
// support for fp8e4m3fnuz
std::set<std::string> unsupported_fp8e4m3fnuz_ops = {};
if(disabled(MIGRAPHX_ENABLE_HIPBLASLT_GEMM{}) and not gpu::rocblas_fp8_available())
if(enabled(MIGRAPHX_DISABLE_HIPBLASLT_GEMM{}) and not gpu::rocblas_fp8_available())
{
unsupported_fp8e4m3fnuz_ops.insert("dot");
unsupported_fp8e4m3fnuz_ops.insert("quant_dot");
Expand All @@ -134,19 +134,14 @@ std::vector<pass> target::get_passes(migraphx::context& gctx, const compile_opti

std::set<std::string> unsupported_fp8e5m2fnuz_ops = unsupported_fp8e4m3fnuz_ops;
// disable gemm for fp8e5m2fnuz if rocBLAS is being used
if(disabled(MIGRAPHX_ENABLE_HIPBLASLT_GEMM{}))
if(enabled(MIGRAPHX_DISABLE_HIPBLASLT_GEMM{}))
{
unsupported_fp8e5m2fnuz_ops.insert("dot");
unsupported_fp8e5m2fnuz_ops.insert("quant_dot");
}

std::set<std::string> unsupported_fp8ocp_ops = {};
// TODO: remove this when the flag is removed
if(disabled(MIGRAPHX_ENABLE_HIPBLASLT_GEMM{}))
{
unsupported_fp8ocp_ops.insert("dot");
unsupported_fp8ocp_ops.insert("quant_dot");
}

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

0 comments on commit c3b42d0

Please sign in to comment.