Skip to content

Commit 7c42cff

Browse files
dineshReddy6381Dinesh Reddy
andauthored
Fix posix build (#73)
* Fix for ggml posix build error. 1.Disabled AMX (Advanced Matrix Extensions): -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 → Don't use AMX instructions -mno-avx512bf16 → Don't use AVX512-BF16 instructions -mno-avxvnni → Don't use AVX-VNNI instructions 2. CMake Flags (-DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF -DGGML_AMX_BF16=OFF -DGGML_AVX512_BF16=OFF -DGGML_AVX_VNNI=OFF). Control CMake's build configuration and do two things: -Prevent explicit compiler flags -Prevent preprocessor defines which enables AMX-specific code paths in the source code Signed-off-by: Dinesh Reddy <[email protected]> * In Posix while running models OPU profiling results are printing twice. Second call to print profiling results (in tsi_cleanup()) has been commented out. Signed-off-by: Dinesh Reddy <[email protected]> --------- Signed-off-by: Dinesh Reddy <[email protected]> Co-authored-by: Dinesh Reddy <[email protected]>
1 parent 59557f2 commit 7c42cff

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

ggml/src/ggml-tsavorite/ggml-tsavorite.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,11 @@ tsi_cleanup() {
741741
tsi_finalize();
742742
GGML_TSAVORITE_LOG_INFO("Start %s\n", __func__);
743743
tsirt::utils::TSIProfiler::finalize();
744-
std::cout << "\nOPU Profiling Results:" << std::endl;
745-
std::cout << tsirt::utils::TSIProfiler::getFormattedResults(
746-
/*truncateFuncNames*/ true)
747-
<< std::endl;
744+
// Profiling results already printed during first cleanup
745+
// std::cout << "\nOPU Profiling Results:" << std::endl;
746+
// std::cout << tsirt::utils::TSIProfiler::getFormattedResults(
747+
// /*truncateFuncNames*/ true)
748+
// << std::endl;
748749
sleep(2);
749750
GGML_TSAVORITE_LOG_INFO("End %s\n", __func__);
750751
return;

tsi-pkg-build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ cd ../../
4646
echo 'building llama.cp, ggml for tsavorite and other binary for posix'
4747
if [ "$(echo "$1" | tr '[:upper:]' '[:lower:]')" = "release" ];
4848
then
49-
cmake -B build-posix -DGGML_TSAVORITE=ON -DGGML_TSAVORITE_TARGET=posix -DCMAKE_C_FLAGS="-DGGML_PERF_RELEASE -DGGML_TARGET_POSIX -DGGML_TSAVORITE" -DCMAKE_CXX_FLAGS="-DGGML_PERF_RELEASE -DGGML_TARGET_POSIX -DGGML_TSAVORITE"
49+
cmake -B build-posix -DGGML_TSAVORITE=ON -DGGML_TSAVORITE_TARGET=posix -DGGML_NATIVE=ON -DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF -DGGML_AMX_BF16=OFF -DGGML_AVX512_BF16=OFF -DGGML_AVX_VNNI=OFF -DCMAKE_C_FLAGS="-DGGML_PERF_RELEASE -DGGML_TARGET_POSIX -DGGML_TSAVORITE -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-avx512bf16 -mno-avxvnni" -DCMAKE_CXX_FLAGS="-DGGML_PERF_RELEASE -DGGML_TARGET_POSIX -DGGML_TSAVORITE -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-avx512bf16 -mno-avxvnni"
5050
elif [ "$(echo "$1" | tr '[:upper:]' '[:lower:]')" = "debug" ]; then
51-
cmake -B build-posix -DGGML_TSAVORITE=ON -DGGML_TSAVORITE_TARGET=posix -DCMAKE_C_FLAGS="-DGGML_PERF_DETAIL -DGGML_TARGET_POSIX -DGGML_TSAVORITE" -DCMAKE_CXX_FLAGS="-DGGML_PERF_DETAIL -DGGML_TARGET_POSIX -DGGML_TSAVORITE"
51+
cmake -B build-posix -DGGML_TSAVORITE=ON -DGGML_TSAVORITE_TARGET=posix -DGGML_NATIVE=ON -DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF -DGGML_AMX_BF16=OFF -DGGML_AVX512_BF16=OFF -DGGML_AVX_VNNI=OFF -DCMAKE_C_FLAGS="-DGGML_PERF_DETAIL -DGGML_TARGET_POSIX -DGGML_TSAVORITE -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-avx512bf16 -mno-avxvnni" -DCMAKE_CXX_FLAGS="-DGGML_PERF_DETAIL -DGGML_TARGET_POSIX -DGGML_TSAVORITE -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-avx512bf16 -mno-avxvnni"
5252
else
53-
cmake -B build-posix -DGGML_TSAVORITE=ON -DGGML_TSAVORITE_TARGET=posix -DCMAKE_C_FLAGS="-DGGML_PERF -DGGML_TARGET_POSIX -DGGML_TSAVORITE" -DCMAKE_CXX_FLAGS="-DGGML_PERF -DGGML_TARGET_POSIX -DGGML_TSAVORITE"
53+
cmake -B build-posix -DGGML_TSAVORITE=ON -DGGML_TSAVORITE_TARGET=posix -DGGML_NATIVE=ON -DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF -DGGML_AMX_BF16=OFF -DGGML_AVX512_BF16=OFF -DGGML_AVX_VNNI=OFF -DCMAKE_C_FLAGS="-DGGML_PERF -DGGML_TARGET_POSIX -DGGML_TSAVORITE -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-avx512bf16 -mno-avxvnni" -DCMAKE_CXX_FLAGS="-DGGML_PERF -DGGML_TARGET_POSIX -DGGML_TSAVORITE -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-avx512bf16 -mno-avxvnni"
5454
fi
5555

56+
5657
cmake --build build-posix --config Release
5758

5859
# Fix GLIBC compatibility for TSI binaries

0 commit comments

Comments
 (0)