-
Couldn't load subscription status.
- Fork 75
Build PTI wheels from sources #5383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
anmyachev
wants to merge
13
commits into
main
Choose a base branch
from
amyachev/issue5278
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+240
−16
Draft
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7731eb9
Build PTI wheels from sources
anmyachev a3a701e
set 'PTI_LIBS_DIR' while initialize proton
anmyachev a7567fc
use 'TRITON_XPUPTI_LIB_PATH' instead of 'PTI_LIBS_DIR'
anmyachev 6d800da
set LD_LIBRARY_PATH since PTI depends on new release of level_zero
anmyachev 1b9d068
Apply suggestion from @anmyachev
anmyachev 3e8304f
export
anmyachev f0a630a
Apply suggestion from @anmyachev
anmyachev 316a6d7
add 'pti_lib.py' script
anmyachev 5520200
Merge remote-tracking branch 'origin' into amyachev/issue5278
anmyachev 5144e51
build PTI in 'build' step and distribute it using 'actions/upload-art…
anmyachev d24fa03
fix build level_zero
anmyachev f8d50a0
try to avoid using new l0 in PTI runtime
anmyachev e679460
cleanup
anmyachev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 15a201d25e5659692613b98ee33513263b689101 | ||
| 7286b06950ea82edd6dd07367072df65f1a24fc4 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 = "[email protected]" } | ||
| ] | ||
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.