From 77c6e00626f56b5418ebdd2ee0bc99d2fb004174 Mon Sep 17 00:00:00 2001 From: Anoop Kapoor Date: Fri, 5 Dec 2025 16:07:50 -0800 Subject: [PATCH 1/2] @FIR-1106 - GGML new release changes for sdk-2.2 --- CMakeLists.txt | 7 ++++--- ggml-tsi-kernel | 2 +- tsi-pkg-build.sh | 27 +++++++++++++++++---------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 597986dcec4..f2f2b70fb3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ if (GGML_TSAVORITE) if (NOT DEFINED MLIR_COMPILER_DIR) if (NOT DEFINED $ENV{MLIR_SDK_VERSION}) - set (MLIR_COMPILER_DIR /proj/rel/sw/sdk-r.0.2.0/compiler) + set (MLIR_COMPILER_DIR /proj/rel/sw/sdk-r.0.2.2/compiler) message("MLIR_SDK_VERSION not set defaulting to ${MLIR_COMPILER_DIR}") else() set (MLIR_COMPILER_DIR $ENV{MLIR_SDK_VERSION}/compiler) @@ -24,7 +24,7 @@ if (GGML_TSAVORITE) if (NOT DEFINED RUNTIME_DIR) if (NOT DEFINED $ENV{MLIR_SDK_VERSION}) - set (RUNTIME_DIR /proj/rel/sw/sdk-r.0.2.0/${GGML_TSAVORITE_TARGET}/runtime) + set (RUNTIME_DIR /proj/rel/sw/sdk-r.0.2.2/${GGML_TSAVORITE_TARGET}/runtime) message("MLIR_SDK_VERSION not set defaulting to ${RUNTIME_DIR}") else() set (RUNTIME_DIR $ENV{MLIR_SDK_VERSION}/${GGML_TSAVORITE_TARGET}/runtime) @@ -51,7 +51,8 @@ if (GGML_TSAVORITE) include_directories($ENV{TSAVORITE_SYSROOT_INCLUDE_DIR}) include_directories(${TSAVORITE_INCLUDE_DIR}) - include_directories(${MLIR_COMPILER_DIR}/include/runtime/shim) + #include_directories(${MLIR_COMPILER_DIR}/include/runtime/shim) + include_directories(${MLIR_COMPILER_DIR}/include/tsi-rt/shim) include_directories(${RUNTIME_DIR}/include) message("tsavorite backend is enabled") endif() diff --git a/ggml-tsi-kernel b/ggml-tsi-kernel index 8330ece6c16..3e2b585b771 160000 --- a/ggml-tsi-kernel +++ b/ggml-tsi-kernel @@ -1 +1 @@ -Subproject commit 8330ece6c167540cd58f9e1cf4f8bc06af513450 +Subproject commit 3e2b585b77104119860072f170061bd3ff8c7317 diff --git a/tsi-pkg-build.sh b/tsi-pkg-build.sh index d8f186720cd..03a9251eacf 100755 --- a/tsi-pkg-build.sh +++ b/tsi-pkg-build.sh @@ -9,20 +9,27 @@ set -e +export MLIR_SDK_VERSION=/proj/rel/sw/sdk-r.0.2.2 +export TOOLBOX_DIR=${MLIR_SDK_VERSION}/toolbox/build/install +pip install --upgrade pip +pip install torch==2.7.0 +pip install -r ${MLIR_SDK_VERSION}/compiler/python/requirements-common.txt +pip install ${MLIR_SDK_VERSION}/compiler/python/mlir_external_packages-1.5.0-py3-none-any.whl +pip install onnxruntime-training #Ensure prerequisites are met as follows echo 'updating submodule' git submodule update --recursive --init cd ggml-tsi-kernel/ #module load gcc/13.3.0 -export MLIR_SDK_VERSION=/proj/rel/sw/sdk-r.0.2.0 -echo 'creating python virtual env' -/proj/local/Python-3.10.12/bin/python3 -m venv blob-creation -source blob-creation/bin/activate -echo 'installing mlir and python dependencies' -pip install --upgrade pip -pip install -r ${MLIR_SDK_VERSION}/compiler/python/requirements-common.txt -pip install ${MLIR_SDK_VERSION}/compiler/python/mlir_external_packages-1.4.2-py3-none-any.whl -pip install onnxruntime-training +#echo 'creating python virtual env' +#/proj/local/Python-3.10.12/bin/python3 -m venv blob-creation +#source blob-creation/bin/activate +#echo 'installing mlir and python dependencies' +#pip install --upgrade pip +#pip install torch==2.7.0 +#pip install -r ${MLIR_SDK_VERSION}/compiler/python/requirements-common.txt +#pip install ${MLIR_SDK_VERSION}/compiler/python/mlir_external_packages-1.5.0-py3-none-any.whl +#pip install onnxruntime-training #build TSI kernels for the Tsavorite backend #First for FPGA @@ -97,7 +104,7 @@ cmake --build build-fpga --config Release echo 'creating tar bundle for fpga' -TSI_GGML_VERSION=0.2.2 +TSI_GGML_VERSION=0.2.3 TSI_GGML_BUNDLE_INSTALL_DIR=tsi-ggml GGML_TSI_INSTALL_DIR=ggml-tsi-kernel TSI_GGML_RELEASE_DIR=/proj/rel/sw/ggml From 1b620792de50e5fef1b0fc16714d5d2fb7f733a2 Mon Sep 17 00:00:00 2001 From: Anoop Kapoor Date: Fri, 5 Dec 2025 16:11:14 -0800 Subject: [PATCH 2/2] Address Ashish's comment --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2f2b70fb3d..5052d663826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,6 @@ if (GGML_TSAVORITE) include_directories($ENV{TSAVORITE_SYSROOT_INCLUDE_DIR}) include_directories(${TSAVORITE_INCLUDE_DIR}) - #include_directories(${MLIR_COMPILER_DIR}/include/runtime/shim) include_directories(${MLIR_COMPILER_DIR}/include/tsi-rt/shim) include_directories(${RUNTIME_DIR}/include) message("tsavorite backend is enabled")