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
3 changes: 1 addition & 2 deletions .github/workflows/build-test-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ jobs:
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
echo "LD_LIBRARY_PATH=$PTI_LIBS_DIR:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV

- name: Report environment details
timeout-minutes: 1
Expand Down Expand Up @@ -294,7 +294,6 @@ jobs:
- name: 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 ..
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ jobs:
pip install -U pybind11 cmake
pip install -v '.[build,tests,tutorials]'

- name: Build && Install PTI
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
cd ${{ env.NEW_WORKSPACE }}
bash -c './scripts/install-pti.sh --build-level-zero'
$PTI_LIBS_DIR = python ./scripts/pti_lib.py
ls $PTI_LIBS_DIR
echo "PATH=$PTI_LIBS_DIR;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Triton version
run: |
.venv\Scripts\activate.ps1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pip-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ jobs:
.venv\Scripts\activate.ps1
python -c 'import triton; print(triton.__version__)'

- name: Build && Install PTI
run: |
.venv\Scripts\activate.ps1
Invoke-BatchFile "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
cd ${{ env.NEW_WORKSPACE }}
bash -c './scripts/install-pti.sh --build-level-zero'
$PTI_LIBS_DIR = python ./scripts/pti_lib.py
ls $PTI_LIBS_DIR
echo "PATH=$PTI_LIBS_DIR;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Install test dependencies
run: |
.venv\Scripts\activate.ps1
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pip-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ jobs:
- name: Install Triton
uses: ./.github/actions/setup-triton

- name: Build && Install PTI
run: |
./scripts/install-pti.sh --build-level-zero
PTI_LIBS_DIR=$(python ./scripts/pti_lib.py)
ls $PTI_LIBS_DIR
echo "LD_LIBRARY_PATH=$PTI_LIBS_DIR:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV

- name: Install runtime dependencies
run: |
curl -sSLO --retry 10 https://raw.githubusercontent.com/pytorch/pytorch/$(<.github/pins/pytorch.txt)/.github/scripts/generate_binary_build_matrix.py
Expand Down
3 changes: 0 additions & 3 deletions python/test/unit/language/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ def test_print(func_type: str, data_type: str, device: str):
return

outs = [line for line in proc.stdout.decode("UTF-8").splitlines() if line]
# FIXME: workaround for DLE 2025.2, namely PTI 0.13.1
# https://github.com/intel/intel-xpu-backend-for-triton/issues/4998
outs = filter(lambda elem: "Another subscriber already subscribed to Sycl runtime events" not in elem, outs)
# The total number of elements in the 1-D tensor to print.
N = 128

Expand Down
26 changes: 22 additions & 4 deletions scripts/install-pti.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,23 @@ function build_level_zero {
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"
if [[ $OSTYPE = msys ]]; then
pwsh -Command \
"Invoke-WebRequest -Uri 'https://github.com/oneapi-src/level-zero/archive/refs/tags/v${LEVEL_ZERO_VERSION}.tar.gz' -OutFile 'v${LEVEL_ZERO_VERSION}.tar.gz'"
ls . -alh
FILE_HASH=$(pwsh -Command "Get-FileHash -Algorithm SHA256 v${LEVEL_ZERO_VERSION}.tar.gz | Select-Object -ExpandProperty Hash")
# convert to lowercase
FILE_HASH=${FILE_HASH,,}
echo $FILE_HASH
if [[ "$FILE_HASH" != "${LEVEL_ZERO_SHA256}" ]]; then
echo "ERROR: Checksum does not match!"
exit 1
fi
else
wget "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"
fi
tar -xf "v${LEVEL_ZERO_VERSION}.tar.gz"
cd "level-zero-${LEVEL_ZERO_VERSION}"
echo "${LEVEL_ZERO_VERSION}" | awk -F. '{print $3}' > VERSION_PATCH
Expand All @@ -56,7 +70,11 @@ function build_level_zero {
cmake --build . --config Release --parallel "$(nproc)"
cmake --build . --config Release --target install
export LEVELZERO_INCLUDE_DIR="$L0_INSTALL_PATH/include"
export LEVELZERO_LIBRARY="$L0_INSTALL_PATH/lib/libze_loader.so"
if [[ $OSTYPE = msys ]]; then
export LEVELZERO_LIBRARY="$L0_INSTALL_PATH/lib/ze_loader.lib"
else
export LEVELZERO_LIBRARY="$L0_INSTALL_PATH/lib/libze_loader.so"
fi
}

function build_pti {
Expand Down
2 changes: 1 addition & 1 deletion scripts/pti_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_pti_lib_path() -> pathlib.Path:
"""
files = importlib.metadata.files('intel-pti') or []
for f in files:
if f.name == 'libpti_view.so':
if f.name in ('libpti_view.so', 'pti_view.lib'):
return pathlib.Path(f.locate()).parent.resolve()
raise AssertionError('libpti_view.so not found')

Expand Down
Loading