Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions kt-kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_definitions(FMT_HEADER_ONLY)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ffast-math")
set(CMAKE_BUILD_TYPE "Release")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
# set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(OpenMP REQUIRED)
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
Expand Down
16 changes: 8 additions & 8 deletions kt-kernel/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,6 @@ build_step() {
# Close MANUAL_MODE conditional
fi

# Set defaults for optional variables
export CPUINFER_BUILD_TYPE=${CPUINFER_BUILD_TYPE:-Release}
export CPUINFER_PARALLEL=${CPUINFER_PARALLEL:-8}
export CPUINFER_VERBOSE=${CPUINFER_VERBOSE:-1}

echo "=========================================="
echo "Building kt-kernel with configuration:"
echo "=========================================="
Expand All @@ -397,11 +392,16 @@ echo " CPUINFER_ENABLE_AMX = $CPUINFER_ENABLE_AMX"
echo " CPUINFER_ENABLE_AVX512_VNNI = ${CPUINFER_ENABLE_AVX512_VNNI:-AUTO}"
echo " CPUINFER_ENABLE_AVX512_BF16 = ${CPUINFER_ENABLE_AVX512_BF16:-AUTO}"
echo " CPUINFER_ENABLE_AVX512_VBMI = ${CPUINFER_ENABLE_AVX512_VBMI:-AUTO}"
echo " CPUINFER_BUILD_TYPE = $CPUINFER_BUILD_TYPE"
echo " CPUINFER_PARALLEL = $CPUINFER_PARALLEL"
echo " CPUINFER_BUILD_TYPE = ${CPUINFER_BUILD_TYPE:-Release}"
echo " CPUINFER_PARALLEL = ${CPUINFER_PARALLEL:-AUTO}"
echo " CPUINFER_VERBOSE = ${CPUINFER_VERBOSE:-1}"
echo ""

pip install . -v
if [ ${CPUINFER_VERBOSE:-1} = "0" ]; then
python3 -m pip install .
else
python3 -m pip install . -v
fi
Comment on lines +400 to +404
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and avoid duplicating the python3 -m pip install . command, you could determine the verbosity flag first and then call the command once. This makes the script slightly cleaner and easier to modify in the future.

Suggested change
if [ ${CPUINFER_VERBOSE:-1} = "0" ]; then
python3 -m pip install .
else
python3 -m pip install . -v
fi
PIP_VERBOSE_FLAG=""
if [ "${CPUINFER_VERBOSE:-1}" != "0" ]; then
PIP_VERBOSE_FLAG="-v"
fi
python3 -m pip install . $PIP_VERBOSE_FLAG

}

# Subcommand dispatcher: default to "all"
Expand Down