From 7731eb92e14279475918e3062d3c69ff75170c5f Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Fri, 24 Oct 2025 14:07:43 +0000 Subject: [PATCH 01/14] Build PTI wheels from sources Signed-off-by: Anatoly Myachev --- .github/pins/pti.txt | 2 +- .github/workflows/build-test-reusable.yml | 16 +----- scripts/build_pti_data/CMakeLists.txt | 49 +++++++++++++++++ scripts/build_pti_data/README.md | 0 scripts/build_pti_data/pyproject.toml | 54 +++++++++++++++++++ scripts/install-pti.sh | 65 +++++++++++++++++++++++ 6 files changed, 170 insertions(+), 16 deletions(-) create mode 100644 scripts/build_pti_data/CMakeLists.txt create mode 100644 scripts/build_pti_data/README.md create mode 100644 scripts/build_pti_data/pyproject.toml create mode 100755 scripts/install-pti.sh diff --git a/.github/pins/pti.txt b/.github/pins/pti.txt index ca98925e9d..9506daa9e9 100644 --- a/.github/pins/pti.txt +++ b/.github/pins/pti.txt @@ -1 +1 @@ -15a201d25e5659692613b98ee33513263b689101 +7286b06950ea82edd6dd07367072df65f1a24fc4 diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 8ef0f9a78f..7d3d32e29b 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -283,21 +283,7 @@ jobs: - name: Build PTI && Run Proton tests if: matrix.suite == 'rest' run: | - # `intel-pti` can be installed in "Setup PyTorch" step with `pytorch_mode==wheels` - pip uninstall intel-pti -y - PTI_COMMIT_ID="$(<.github/pins/pti.txt)" - git clone https://github.com/intel/pti-gpu.git - cd pti-gpu - git checkout $PTI_COMMIT_ID - cd sdk - cmake --preset linux-icpx-release - BUILD_TESTING=1 PTI_BUILD_SAMPLES=1 cmake --build --preset linux-icpx-release - - PTI_LIBS_DIR="$(pwd)/build-linux-icpx-release/lib/" - cd ../.. - - export LD_LIBRARY_PATH=$PTI_LIBS_DIR:$LD_LIBRARY_PATH - export TRITON_XPUPTI_LIB_PATH=$PTI_LIBS_DIR + ./scripts/install-pti.sh cd third_party/proton/test pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. diff --git a/scripts/build_pti_data/CMakeLists.txt b/scripts/build_pti_data/CMakeLists.txt new file mode 100644 index 0000000000..e2532c78d4 --- /dev/null +++ b/scripts/build_pti_data/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.20) + +project( + pti-python-binaries + VERSION 0.0.1 + LANGUAGES C CXX) + +include(FetchContent) + +if(DEFINED ENV{PTI_PINNED_COMMIT}) + set(PTI_PINNED_COMMIT $ENV{PTI_PINNED_COMMIT}) +else() + message(FATAL_ERROR "PTI_PINNED_COMMIT env var not defined") +endif() + +if(DEFINED ENV{LEVELZERO_INCLUDE_DIR}) + set(LevelZero_INCLUDE_DIR "$ENV{LEVELZERO_INCLUDE_DIR}") +else() + message(STATUS "LEVELZERO_INCLUDE_DIR env var not defined; try to use system version") +endif() + +if(DEFINED ENV{LEVELZERO_LIBRARY}) + set(LevelZero_LIBRARY "$ENV{LEVELZERO_LIBRARY}") +else() + message(STATUS "LEVELZERO_LIBRARY env var not defined; try to use system version") +endif() + +FetchContent_Declare( + pti-lib + GIT_REPOSITORY https://github.com/intel/pti-gpu.git + GIT_TAG ${PTI_PINNED_COMMIT} + SOURCE_SUBDIR sdk +) + +if(NOT APPLE) + list(APPEND CMAKE_INSTALL_RPATH $ORIGIN) +endif() + +# Sets the installation directories to be inside the root of the virtual +# environment, .e.g., .venv/lib/libpti_view.so (note: this is non-standard). +# However, this is what other oneAPI components and PyTorch XPU (Intel backend) +# expects. +set(CMAKE_INSTALL_LIBDIR "${SKBUILD_DATA_DIR}/lib") +set(CMAKE_INSTALL_INCLUDEDIR "${SKBUILD_DATA_DIR}/include") +set(CMAKE_INSTALL_BINDIR "${SKBUILD_DATA_DIR}/bin") +set(CMAKE_INSTALL_DOCDIR "${SKBUILD_DATA_DIR}/share") + + +FetchContent_MakeAvailable(pti-lib) diff --git a/scripts/build_pti_data/README.md b/scripts/build_pti_data/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/build_pti_data/pyproject.toml b/scripts/build_pti_data/pyproject.toml new file mode 100644 index 0000000000..237533b08d --- /dev/null +++ b/scripts/build_pti_data/pyproject.toml @@ -0,0 +1,54 @@ +[project] +name = "intel-pti" +version = "0.14.0.dev1" +description = "Add your description here" +readme = "README.md" +authors = [ + { name = "Intel Corporation", email = "scripting@intel.com" } +] +license = "MIT" + +requires-python = ">=3.9" +dependencies = [] +classifiers = [ + "Development Status :: 5 - Production/Stable", + + # Indicate who your project is intended for + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", + "Intended Audience :: Other Audience", + + "Topic :: Software Development :: Libraries", + + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + + "Environment :: GPU", +] + +[tool.scikit-build] +build.verbose = true +logging.level = "INFO" +cmake.version = ">=3.20.0" +cmake.build-type = "Release" +cmake.args = ["-GNinja"] +ninja.version = ">=1.13" +minimum-version = "build-system.requires" +sdist.exclude = ["levelzero", "level-zero", "src"] +#experimental = true +#wheel.install-dir = "/data" + +[tool.uv] +cache-keys = [{ file = "pyproject.toml" }, { file = "CMakeLists.txt" }] + +[build-system] +requires = ["scikit-build-core>=0.10"] +build-backend = "scikit_build_core.build" + +[project.urls] +Homepage = "https://github.com/intel/pti-gpu/tree/master/sdk" +Documentation = "https://github.com/intel/pti-gpu/blob/master/sdk/README.md" +Repository = "https://github.com/intel/pti-gpu" +Issues = "https://github.com/intel/pti-gpu/issues" diff --git a/scripts/install-pti.sh b/scripts/install-pti.sh new file mode 100755 index 0000000000..9884b0026c --- /dev/null +++ b/scripts/install-pti.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +set -euo pipefail + + +# Configure, build and install PyTorch from source. + +# intel-xpu-backend-for-triton project root +ROOT=$(cd "$(dirname "$0")/.." && pwd) + +SCRIPTS_DIR=$ROOT/scripts +PTI_PROJ=$ROOT/.scripts_cache/pti +LEVEL_ZERO_PROJ=$ROOT/.scripts_cache/level_zero_for_pti +BASE=$(dirname "$PTI_PROJ") + +echo "**** BASE is set to $BASE ****" +echo "**** PTI_PROJ is set to $PTI_PROJ ****" +mkdir -p $BASE + +function build_level_zero { + rm -rf "$LEVEL_ZERO_PROJ" + mkdir -p "$LEVEL_ZERO_PROJ" + cd "$LEVEL_ZERO_PROJ" + LEVEL_ZERO_VERSION=1.24.2 + LEVEL_ZERO_SHA256=b77e6e28623134ee4e99e2321c127b554bdd5bfa3e80064922eba293041c6c52 + + wget --progress=dot:giga -e use_proxy=yes "https://github.com/oneapi-src/level-zero/archive/refs/tags/v${LEVEL_ZERO_VERSION}.tar.gz" + echo "${LEVEL_ZERO_SHA256} v${LEVEL_ZERO_VERSION}.tar.gz" > "v${LEVEL_ZERO_VERSION}.tar.gz.sha256" + sha256sum -c "v${LEVEL_ZERO_VERSION}.tar.gz.sha256" + tar -xf "v${LEVEL_ZERO_VERSION}.tar.gz" + cd "level-zero-${LEVEL_ZERO_VERSION}" + echo "${LEVEL_ZERO_VERSION}" | awk -F. '{print $3}' > VERSION_PATCH + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release + cmake --build . --config Release --parallel "$(nproc)" + # cmake --build . --config Release --target install + export LEVELZERO_INCLUDE_DIR="$LEVEL_ZERO_PROJ/level-zero-${LEVEL_ZERO_VERSION}" + export LEVELZERO_LIBRARY="$LEVEL_ZERO_PROJ/level-zero-${LEVEL_ZERO_VERSION}/build/lib/libze_loader.so" +} + +function build_pti { + rm -rf "$PTI_PROJ" + mkdir -p "$PTI_PROJ" + + echo "****** Building $PTI_PROJ ******" + cd "$PTI_PROJ" + cp "$SCRIPTS_DIR"/build_pti_data/* . + pip install uv + + export PTI_PINNED_COMMIT="$(<$ROOT/.github/pins/pti.txt)" + + uv version 0.14.0.dev1 + uv build +} + +function install_pti { + echo "****** Installing PTI ******" + cd "$PTI_PROJ" + pip install dist/*.whl +} + +build_level_zero +build_pti +install_pti From a3a701eb584fe8fb0cf28b10eb52e4d275ef3bb5 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Fri, 24 Oct 2025 19:40:06 +0000 Subject: [PATCH 02/14] set 'PTI_LIBS_DIR' while initialize proton Signed-off-by: Anatoly Myachev --- third_party/proton/proton/profile.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/third_party/proton/proton/profile.py b/third_party/proton/proton/profile.py index 3e1f54e4aa..5d5de97d08 100644 --- a/third_party/proton/proton/profile.py +++ b/third_party/proton/proton/profile.py @@ -1,3 +1,7 @@ +from typing import Optional, Union +import importlib.metadata +import pathlib +import os import functools import triton @@ -6,7 +10,6 @@ from .flags import flags from .hooks import HookManager, LaunchHook, InstrumentationHook from .mode import BaseMode -from typing import Optional, Union DEFAULT_PROFILE_NAME = "proton" UTILS_CACHE_PATH = None @@ -21,6 +24,12 @@ def _select_backend() -> str: elif backend == "xpu": global UTILS_CACHE_PATH UTILS_CACHE_PATH = triton.runtime.driver.active.build_proton_help_lib() + files = importlib.metadata.files('intel-pti') + if files is not None: + for f in files: + if f.name == 'libpti_view.so': + os.environ["PTI_LIBS_DIR"] = str(pathlib.Path(f.locate()).parent.resolve()) + break return "xpupti" else: raise ValueError("No backend is available for the current target.") From a7567fc88ec5e7a086dd038041e8b2ee468a5d91 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Fri, 24 Oct 2025 20:13:59 +0000 Subject: [PATCH 03/14] use 'TRITON_XPUPTI_LIB_PATH' instead of 'PTI_LIBS_DIR' Signed-off-by: Anatoly Myachev --- third_party/proton/proton/profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/proton/proton/profile.py b/third_party/proton/proton/profile.py index 5d5de97d08..4e914febc9 100644 --- a/third_party/proton/proton/profile.py +++ b/third_party/proton/proton/profile.py @@ -28,7 +28,7 @@ def _select_backend() -> str: if files is not None: for f in files: if f.name == 'libpti_view.so': - os.environ["PTI_LIBS_DIR"] = str(pathlib.Path(f.locate()).parent.resolve()) + os.environ["TRITON_XPUPTI_LIB_PATH"] = str(pathlib.Path(f.locate()).parent.resolve()) break return "xpupti" else: From 6d800daca068bace2e0915b7d6bf32f28b31258d Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Sun, 26 Oct 2025 12:49:15 +0000 Subject: [PATCH 04/14] set LD_LIBRARY_PATH since PTI depends on new release of level_zero Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 7d3d32e29b..663d507d95 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -285,7 +285,7 @@ jobs: run: | ./scripts/install-pti.sh cd third_party/proton/test - pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v + LD_LIBRARY_PATH=.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/:$LD_LIBRARY_PATH pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. - name: Run minicore tests From 1b9d0684b106be93c2910da6f97b55637c1eb6d3 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Sun, 26 Oct 2025 14:31:28 +0100 Subject: [PATCH 05/14] Apply suggestion from @anmyachev Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 663d507d95..d284b11ac4 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -284,8 +284,10 @@ jobs: if: matrix.suite == 'rest' run: | ./scripts/install-pti.sh + LEVEL_ZERO_LIB=$(pwd)/.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/ + ls $LEVEL_ZERO_LIB cd third_party/proton/test - LD_LIBRARY_PATH=.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/:$LD_LIBRARY_PATH pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v + LD_LIBRARY_PATH=$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. - name: Run minicore tests From 3e8304fdf0765066b47c49dceee52f8ef857404c Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Sun, 26 Oct 2025 14:46:11 +0000 Subject: [PATCH 06/14] export Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index d284b11ac4..906b414acb 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -286,8 +286,9 @@ jobs: ./scripts/install-pti.sh LEVEL_ZERO_LIB=$(pwd)/.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/ ls $LEVEL_ZERO_LIB + export LD_LIBRARY_PATH=$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH cd third_party/proton/test - LD_LIBRARY_PATH=$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v + pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. - name: Run minicore tests From f0a630aa58c0fe9395df26f7830c990903032d84 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Sun, 26 Oct 2025 16:45:58 +0100 Subject: [PATCH 07/14] Apply suggestion from @anmyachev --- .github/pins/pti.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pins/pti.txt b/.github/pins/pti.txt index 9506daa9e9..ca98925e9d 100644 --- a/.github/pins/pti.txt +++ b/.github/pins/pti.txt @@ -1 +1 @@ -7286b06950ea82edd6dd07367072df65f1a24fc4 +15a201d25e5659692613b98ee33513263b689101 From 316a6d72a85156db5e41444f96cb6ad74298aaf3 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Sun, 26 Oct 2025 16:22:00 +0000 Subject: [PATCH 08/14] add 'pti_lib.py' script Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 4 +++- scripts/pti_lib.py | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 scripts/pti_lib.py diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 906b414acb..91ae76bb2f 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -284,9 +284,11 @@ jobs: if: matrix.suite == 'rest' run: | ./scripts/install-pti.sh + PTI_LIBS_DIR=$(python ./scripts/pti_lib.py) + ls $PTI_LIBS_DIR LEVEL_ZERO_LIB=$(pwd)/.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/ ls $LEVEL_ZERO_LIB - export LD_LIBRARY_PATH=$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=$PTI_LIBS_DIR:$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH cd third_party/proton/test pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. diff --git a/scripts/pti_lib.py b/scripts/pti_lib.py new file mode 100644 index 0000000000..75d70fe1b8 --- /dev/null +++ b/scripts/pti_lib.py @@ -0,0 +1,22 @@ +"""Prints a lib directory for pti.""" + +import importlib.metadata +import pathlib + + +def get_pti_lib_path() -> pathlib.Path: + """Returns library path for pti. + + Raises: + importlib.metadata.PackageNotFoundError: if 'intel-pti' not installed. + AssertionError: if libpti_view.so not found. + """ + files = importlib.metadata.files('intel-pti') or [] + for f in files: + if f.name == 'libpti_view.so': + return pathlib.Path(f.locate()).parent.resolve() + raise AssertionError('libpti_view.so not found') + + +if __name__ == '__main__': + print(get_pti_lib_path()) From 5144e51d0c570c55c9f484a6a332dddf73062f0b Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Mon, 27 Oct 2025 13:28:05 +0000 Subject: [PATCH 09/14] build PTI in 'build' step and distribute it using 'actions/upload-artifact' Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 29 +++++++++++++++++++---- scripts/install-pti.sh | 25 ++++++++++++++++++- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 91ae76bb2f..21347334e1 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -127,6 +127,10 @@ jobs: DEBUG=1 python -m build --wheel --no-isolation && pip install dist/*.whl + - name: Build PTI + run: | + ./scripts/install-pti.sh + - name: Set test-triton command line id: test-triton run: | @@ -175,6 +179,12 @@ jobs: name: triton-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }} path: dist/*.whl + - name: Upload PTI wheels + uses: actions/upload-artifact@v4 + with: + name: pti-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }} + path: .scripts_cache/pti/dist/*.whl + - name: Upload test reports uses: actions/upload-artifact@v4 with: @@ -242,11 +252,23 @@ jobs: with: name: triton-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }} + - name: Download PTI wheels + uses: actions/download-artifact@v5 + with: + name: pti-${{ inputs.python_version }}-${{ inputs.runner_label || inputs.driver_version }} + - name: Install Triton run: | pip install triton-*.whl python -c 'import triton; print(triton.__version__)' + - name: Install PTI + run: | + pip install intel_pti-*.whl + PTI_LIBS_DIR=$(python ./scripts/pti_lib.py) + ls $PTI_LIBS_DIR + echo "PTI_LIBS_DIR=$PTI_LIBS_DIR" | tee -a $GITHUB_ENV + - name: Report environment details run: | if [ "${{ matrix.suite }}" == "minicore" ]; then @@ -283,12 +305,11 @@ jobs: - name: Build PTI && Run Proton tests if: matrix.suite == 'rest' run: | - ./scripts/install-pti.sh - PTI_LIBS_DIR=$(python ./scripts/pti_lib.py) - ls $PTI_LIBS_DIR + # FIXME: after switch to agama 1188, there will be no need to install level-zero + ./scripts/install-pti.sh --build-only-level-zero LEVEL_ZERO_LIB=$(pwd)/.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/ ls $LEVEL_ZERO_LIB - export LD_LIBRARY_PATH=$PTI_LIBS_DIR:$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=${{ env.PTI_LIBS_DIR }}:$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH cd third_party/proton/test pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. diff --git a/scripts/install-pti.sh b/scripts/install-pti.sh index 9884b0026c..8111dfeea5 100755 --- a/scripts/install-pti.sh +++ b/scripts/install-pti.sh @@ -2,6 +2,25 @@ set -euo pipefail +# Select what to build. +BUILD_ONLY_LEVEL_ZERO=false +for arg in "$@"; do + case $arg in + --build-only-level-zero) + BUILD_ONLY_LEVEL_ZERO=true + shift + ;; + --help) + echo "Example usage: ./install-pti.sh [--build-only-level-zero]" + exit 1 + ;; + *) + echo "Unknown argument: $arg." + exit 1 + ;; + esac +done + # Configure, build and install PyTorch from source. @@ -60,6 +79,10 @@ function install_pti { pip install dist/*.whl } -build_level_zero +if [ "$BUILD_ONLY_LEVEL_ZERO" = true ]; then + build_level_zero + exit 0 +fi + build_pti install_pti From d24fa034363d3fa7f05693fdec573b0e657e69a0 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Mon, 27 Oct 2025 13:57:45 +0000 Subject: [PATCH 10/14] fix build level_zero Signed-off-by: Anatoly Myachev --- scripts/install-pti.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install-pti.sh b/scripts/install-pti.sh index 8111dfeea5..c2dc46141d 100755 --- a/scripts/install-pti.sh +++ b/scripts/install-pti.sh @@ -84,5 +84,6 @@ if [ "$BUILD_ONLY_LEVEL_ZERO" = true ]; then exit 0 fi +build_level_zero build_pti install_pti From f8d50a04d1591b4e968668564f8d4f8cdcc2c120 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Mon, 27 Oct 2025 14:59:12 +0000 Subject: [PATCH 11/14] try to avoid using new l0 in PTI runtime Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 21347334e1..fa756c5d6a 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -305,11 +305,7 @@ jobs: - name: Build PTI && Run Proton tests if: matrix.suite == 'rest' run: | - # FIXME: after switch to agama 1188, there will be no need to install level-zero - ./scripts/install-pti.sh --build-only-level-zero - LEVEL_ZERO_LIB=$(pwd)/.scripts_cache/level_zero_for_pti/level-zero-1.24.2/build/lib/ - ls $LEVEL_ZERO_LIB - export LD_LIBRARY_PATH=${{ env.PTI_LIBS_DIR }}:$LEVEL_ZERO_LIB:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=${{ env.PTI_LIBS_DIR }}:$LD_LIBRARY_PATH cd third_party/proton/test pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. From e679460d98f9ed31f672498c99eee7310a944581 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Tue, 28 Oct 2025 12:43:04 +0100 Subject: [PATCH 12/14] cleanup Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 2 +- scripts/build_pti_data/pyproject.toml | 5 ----- scripts/install-pti.sh | 12 +++++------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index fa756c5d6a..5e739b2e38 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -129,7 +129,7 @@ jobs: - name: Build PTI run: | - ./scripts/install-pti.sh + ./scripts/install-pti.sh --build-level-zero - name: Set test-triton command line id: test-triton diff --git a/scripts/build_pti_data/pyproject.toml b/scripts/build_pti_data/pyproject.toml index 237533b08d..ed4e1fcb1d 100644 --- a/scripts/build_pti_data/pyproject.toml +++ b/scripts/build_pti_data/pyproject.toml @@ -3,9 +3,6 @@ name = "intel-pti" version = "0.14.0.dev1" description = "Add your description here" readme = "README.md" -authors = [ - { name = "Intel Corporation", email = "scripting@intel.com" } -] license = "MIT" requires-python = ">=3.9" @@ -37,8 +34,6 @@ cmake.args = ["-GNinja"] ninja.version = ">=1.13" minimum-version = "build-system.requires" sdist.exclude = ["levelzero", "level-zero", "src"] -#experimental = true -#wheel.install-dir = "/data" [tool.uv] cache-keys = [{ file = "pyproject.toml" }, { file = "CMakeLists.txt" }] diff --git a/scripts/install-pti.sh b/scripts/install-pti.sh index c2dc46141d..88f661771a 100755 --- a/scripts/install-pti.sh +++ b/scripts/install-pti.sh @@ -3,15 +3,15 @@ set -euo pipefail # Select what to build. -BUILD_ONLY_LEVEL_ZERO=false +BUILD_LEVEL_ZERO=false for arg in "$@"; do case $arg in - --build-only-level-zero) - BUILD_ONLY_LEVEL_ZERO=true + --build-level-zero) + BUILD_LEVEL_ZERO=true shift ;; --help) - echo "Example usage: ./install-pti.sh [--build-only-level-zero]" + echo "Example usage: ./install-pti.sh [--build-level-zero]" exit 1 ;; *) @@ -79,11 +79,9 @@ function install_pti { pip install dist/*.whl } -if [ "$BUILD_ONLY_LEVEL_ZERO" = true ]; then +if [ "$BUILD_LEVEL_ZERO" = true ]; then build_level_zero - exit 0 fi -build_level_zero build_pti install_pti From d1d0c33747e0d3c0ba143bda956896e91959e3b0 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Tue, 28 Oct 2025 14:21:23 +0100 Subject: [PATCH 13/14] try without 'export LD_LIBRARY_PATH' Signed-off-by: Anatoly Myachev --- .github/workflows/build-test-reusable.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 5e739b2e38..79885a7c53 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -305,7 +305,6 @@ jobs: - name: Build PTI && Run Proton tests if: matrix.suite == 'rest' run: | - export LD_LIBRARY_PATH=${{ env.PTI_LIBS_DIR }}:$LD_LIBRARY_PATH cd third_party/proton/test pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd .. From b8a9e0993b68db94a5a5e8cecd51ee3c6526e0c3 Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Tue, 28 Oct 2025 15:20:35 +0100 Subject: [PATCH 14/14] Revert "try without 'export LD_LIBRARY_PATH'" This reverts commit d1d0c33747e0d3c0ba143bda956896e91959e3b0. --- .github/workflows/build-test-reusable.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test-reusable.yml b/.github/workflows/build-test-reusable.yml index 79885a7c53..5e739b2e38 100644 --- a/.github/workflows/build-test-reusable.yml +++ b/.github/workflows/build-test-reusable.yml @@ -305,6 +305,7 @@ jobs: - name: Build PTI && Run Proton tests if: matrix.suite == 'rest' run: | + export LD_LIBRARY_PATH=${{ env.PTI_LIBS_DIR }}:$LD_LIBRARY_PATH cd third_party/proton/test pytest test_api.py test_cmd.py test_lib.py test_profile.py test_viewer.py --device xpu -s -v cd ..