Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cf8ccb8
Create .github/workflows/python-pachage.yml
PokhodenkoSA Mar 30, 2021
40e1a9e
Install Cython
PokhodenkoSA Mar 30, 2021
9a2eb81
Install numpy
PokhodenkoSA Mar 30, 2021
43c731e
Rename python-package.yml
PokhodenkoSA Mar 30, 2021
78e40fb
Install oneAPI
PokhodenkoSA Mar 30, 2021
a8955ce
Save cache
PokhodenkoSA Mar 30, 2021
321905b
Install in Development Mode
PokhodenkoSA Mar 30, 2021
f1b0c1b
Source DPC++ compiler environment
PokhodenkoSA Mar 30, 2021
d10a738
Disable DPCTL_ENABLE_LO_PROGRAM_CREATION
PokhodenkoSA Mar 30, 2021
ce3af13
Clean oneAPI cache
PokhodenkoSA Mar 30, 2021
2b2f991
Checkout with history
PokhodenkoSA Mar 30, 2021
74fdda5
Rub pytest
PokhodenkoSA Mar 30, 2021
d1a62dc
Install pytest-cov
PokhodenkoSA Mar 30, 2021
15b3de8
Source DPC++ compiler env for testing for fixing error with libsycl.so
PokhodenkoSA Mar 30, 2021
99127bb
Create TODOs
PokhodenkoSA Mar 30, 2021
94a82bf
Creare tmate.yml
PokhodenkoSA Mar 31, 2021
1fd28b8
Use tmate in python-package.yml
PokhodenkoSA Mar 31, 2021
dcde836
Run tmate before pytest
PokhodenkoSA Mar 31, 2021
605ec59
Update to onaAPI 2021.2
PokhodenkoSA Apr 2, 2021
cedaaad
Disable testing
PokhodenkoSA Apr 2, 2021
ce7f041
Use only Python 3.7
PokhodenkoSA Apr 2, 2021
c922b25
Enable pytest
PokhodenkoSA Apr 2, 2021
27402d7
Enable tmate
PokhodenkoSA Apr 2, 2021
3fc0ac9
Activate TBB environment for pytest
PokhodenkoSA Apr 2, 2021
08f3bbf
Disable tmate
PokhodenkoSA Apr 2, 2021
ffbf5bf
Clean code
PokhodenkoSA Apr 2, 2021
b26d778
Remove tmate
PokhodenkoSA Apr 2, 2021
31168c0
Add Python 3.8 and 3.9
PokhodenkoSA Apr 2, 2021
5a02f75
Trigger on PR and push to master
PokhodenkoSA Apr 2, 2021
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
59 changes: 59 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Python package

on:
pull_request:
push:
branches: [master]

env:
LINUX_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17769/l_BaseKit_p_2021.2.0.2883_offline.sh
Copy link
Copy Markdown
Contributor

@diptorupd diptorupd May 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PokhodenkoSA Why use this hard coded url? Instead we should just use the APT oneAPI repo. Github actions allow using password-less sudo.

Another option can be to use nightly builds of dpcpp from https://github.com/intel/llvm/releases. I am working on a set of clean ups to our build system that will make it very easy to build with the open source dpcpp.

LINUX_DPCPP_COMPONENTS_WEB: intel.oneapi.lin.dpcpp-cpp-compiler

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

env:
ONEAPI_ROOT: /opt/intel/oneapi

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
Comment on lines +24 to +25
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fetches whole repository history. Is not necessary but with it we can see package version based on tag.


- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Cache oneAPI
id: cache-oneapi
uses: actions/cache@v2
with:
path: |
/opt/intel/oneapi/compiler
/opt/intel/oneapi/tbb
key: build-${{ env.LINUX_BASEKIT_URL }}-${{ env.LINUX_DPCPP_COMPONENTS_WEB }}-compiler-tbb-${{ hashFiles('**/scripts/cache_exclude_linux.sh') }}
- name: Install oneAPI
if: steps.cache-oneapi.outputs.cache-hit != 'true'
run: scripts/install_linux.sh $LINUX_BASEKIT_URL $LINUX_DPCPP_COMPONENTS_WEB
- name: Exclude unused files from oneAPI cache
if: steps.cache-oneapi.outputs.cache-hit != 'true'
run: scripts/cache_exclude_linux.sh
Comment on lines +47 to +49
Copy link
Copy Markdown
Contributor Author

@PokhodenkoSA PokhodenkoSA Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes oneAPI cache folder from 800Mb to 330Mb.


- name: Install in Development Mode
run: |
source $ONEAPI_ROOT/compiler/latest/env/vars.sh
python setup.py develop
- name: Test with pytest
run: |
source $ONEAPI_ROOT/compiler/latest/env/vars.sh
source $ONEAPI_ROOT/tbb/latest/env/vars.sh
pytest
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Cython
numpy
pytest
pytest-cov
Comment on lines +1 to +4
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created requirements.txt for setup python environment.

2 changes: 1 addition & 1 deletion scripts/build_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"-DDPCPP_INSTALL_DIR=" + DPCPP_ROOT,
"-DCMAKE_C_COMPILER:PATH=" + os.path.join(DPCPP_ROOT, "bin", "clang"),
"-DCMAKE_CXX_COMPILER:PATH=" + os.path.join(DPCPP_ROOT, "bin", "dpcpp"),
"-DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON",
# "-DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is blocker for the PR and should be fixed before merging this PR.
LevelZero is not available.

Copy link
Copy Markdown
Contributor Author

@PokhodenkoSA PokhodenkoSA Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ticket for fixing it #361 or #340 will make Level Zero always available by downloading headers from GitHub.

backends,
]
subprocess.check_call(cmake_args, stderr=subprocess.STDOUT, shell=False)
Expand Down
13 changes: 13 additions & 0 deletions scripts/cache_exclude_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
Copy link
Copy Markdown
Contributor Author

@PokhodenkoSA PokhodenkoSA Apr 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# SPDX-FileCopyrightText: 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

#shellcheck disable=SC2010
LATEST_VERSION=$(ls -1 /opt/intel/oneapi/compiler/ | grep -v latest | sort | tail -1)

sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/compiler/lib/ia32_lin
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/bin/ia32
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/lib/emu
sudo rm -rf /opt/intel/oneapi/compiler/"$LATEST_VERSION"/linux/lib/oclfpga
23 changes: 23 additions & 0 deletions scripts/install_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# SPDX-FileCopyrightText: 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

URL=$1
COMPONENTS=$2

curl --output webimage.sh --url "$URL" --retry 5 --retry-delay 5
chmod +x webimage.sh
./webimage.sh -x -f webimage_extracted --log extract.log
rm -rf webimage.sh
WEBIMAGE_NAME=$(ls -1 webimage_extracted/)
if [ -z "$COMPONENTS" ]; then
sudo webimage_extracted/"$WEBIMAGE_NAME"/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
installer_exit_code=$?
else
sudo webimage_extracted/"$WEBIMAGE_NAME"/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
installer_exit_code=$?
fi
rm -rf webimage_extracted
exit $installer_exit_code