Revert "Using znver2 flags for building zen/zen2/zen3 kernels on amdzen builds."

This reverts commit 7d379c7879.

Reason for revert: < Perf regression is observed for GEMM(gemm_small_At)
                    as fma uses memory operand >

Change-Id: I0ec3a22acaacfaade860c67858be6a2ba6296bce
This commit is contained in:
Mangala V
2024-09-02 08:02:50 -04:00
parent e429e57b53
commit 705755bb5c
2 changed files with 36 additions and 56 deletions

View File

@@ -32,54 +32,47 @@
]=]
# If we are building for amdzen, use zen2 flags (znver2)
# for zen/zen2/zen3 cases.
if(${BLIS_CONFIG_FAMILY} STREQUAL "amdzen")
include(${CMAKE_SOURCE_DIR}/config/zen2/make_defs.cmake)
else()
# Include file containing common flags for all AMD architectures except amdzen
# Include file containing common flags for all AMD architectures
include(${CMAKE_SOURCE_DIR}/config/zen/amd_config.cmake)
if(NOT WIN32)
if(NOT (DEBUG_TYPE STREQUAL "off"))
set(CDBGFLAGS -g)
endif()
if(DEBUG_TYPE STREQUAL "noopt")
set(COPTFLAGS -O0)
else() # off or opt
set(COPTFLAGS -O3)
endif()
if(NOT WIN32)
if(NOT (DEBUG_TYPE STREQUAL "off"))
set(CDBGFLAGS -g)
endif()
# Flags specific to LPGEMM kernels.
set(CKLPOPTFLAGS "")
# Flags specific to optimized kernels.
# NOTE: The -fomit-frame-pointer option is needed for some kernels because
# they make explicit use of the rbp register.
if(MSVC)
set(CKOPTFLAGS ${COPTFLAGS} /Oy)
else()
set(CKOPTFLAGS ${COPTFLAGS} -fomit-frame-pointer)
if(DEBUG_TYPE STREQUAL "noopt")
set(COPTFLAGS -O0)
else() # off or opt
set(COPTFLAGS -O3)
endif()
endif()
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
list(APPEND CKVECFLAGS -march=znver1)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0.0)
list(APPEND CKLPOPTFLAGS -fno-tree-partial-pre -fno-tree-pre -fno-tree-loop-vectorize -fno-gcse)
endif()
# Flags specific to LPGEMM kernels.
set(CKLPOPTFLAGS "")
# Flags specific to optimized kernels.
# NOTE: The -fomit-frame-pointer option is needed for some kernels because
# they make explicit use of the rbp register.
if(MSVC)
set(CKOPTFLAGS ${COPTFLAGS} /Oy)
else()
set(CKOPTFLAGS ${COPTFLAGS} -fomit-frame-pointer)
endif()
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
list(APPEND CKVECFLAGS -march=znver1)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0.0)
list(APPEND CKLPOPTFLAGS -fno-tree-partial-pre -fno-tree-pre -fno-tree-loop-vectorize -fno-gcse)
endif()
endif()
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
list(APPEND CKVECFLAGS -march=znver1)
endif() # clang
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
list(APPEND CKVECFLAGS -march=znver1)
endif() # clang
# Flags specific to reference kernels.
set(CROPTFLAGS ${CKOPTFLAGS})
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(CRVECFLAGS ${CKVECFLAGS})
else()
set(CRVECFLAGS ${CKVECFLAGS})
endif()
endif() # amdzen cofig
# Flags specific to reference kernels.
set(CROPTFLAGS ${CKOPTFLAGS})
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(CRVECFLAGS ${CKVECFLAGS})
else()
set(CRVECFLAGS ${CKVECFLAGS})
endif()

View File

@@ -37,18 +37,6 @@
# FLAGS that are common for all the AMD architectures are present in
# config/zen/amd_config.mk.
# In case of amdzen:
# Include zen2 config to use znver2 flag
# THIS_CONFIG variable will be zen2 in zen2 config,
# Hence override the variable with zen.
# For intrinsic code, using znver2 flag improves
# performance significantly
ifeq ($(CONFIG_NAME),amdzen)
-include $(BASE_SHARE_PATH)/config/zen2/make_defs.mk
THIS_CONFIG := zen
$(eval $(call store-make-defs,$(THIS_CONFIG)))
else
# Declare the name of the current configuration and add it to the
# running list of configurations included by common.mk.
THIS_CONFIG := zen
@@ -119,4 +107,3 @@ endif
# configuration name.
$(eval $(call store-make-defs,$(THIS_CONFIG)))
endif # amdzen cofig