From 19e3a51f5dd874027c83d10754a038dfa7f3002c Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 12 Oct 2023 16:45:32 -0500 Subject: [PATCH 01/10] Require dpcpp compiler 2024.0 and runtime >=2024.0 Also introduced jinja variable to keep those two in sync. --- conda-recipe/meta.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 2806fb9262..9e96e43135 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,3 +1,5 @@ +{% set required_compiler_version = "2024.0" %} + package: name: dpctl version: {{ GIT_DESCRIBE_TAG }} @@ -14,7 +16,7 @@ build: requirements: build: - {{ compiler('cxx') }} - - {{ compiler('dpcpp') }} >=2023.2 # [not osx] + - {{ compiler('dpcpp') }} >={{ required_compiler_version }} # [not osx] - sysroot_linux-64 >=2.28 # [linux] host: - setuptools @@ -29,7 +31,7 @@ requirements: run: - python - {{ pin_compatible('numpy', min_pin='x.x', upper_bound='1.26') }} - - dpcpp-cpp-rt >=2023.2 + - dpcpp-cpp-rt >={{ required_compiler_version }} - level-zero # [linux] test: From 69428553db10d9762b318ad819816eb9e263797a Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 14 Nov 2023 08:49:13 -0600 Subject: [PATCH 02/10] Try using validation label --- .github/workflows/conda-package.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index b6a4649a30..7b1e8f3c95 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -48,7 +48,7 @@ jobs: echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV - name: Build conda package run: | - CHANNELS="-c intel -c conda-forge --override-channels" + CHANNELS="-c intel/label/validation -c intel -c conda-forge --override-channels" VERSIONS="--python ${{ matrix.python }}" TEST="--no-test" conda build \ @@ -104,7 +104,7 @@ jobs: - name: Build conda package env: OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides - run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe + run: conda build --no-test --python ${{ matrix.python }} -c intel/label/validation -c intel -c conda-forge --override-channels conda-recipe - name: Upload artifact uses: actions/upload-artifact@v3 with: @@ -127,7 +127,7 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel -c conda-forge --override-channels + CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels steps: - name: Download artifact @@ -212,7 +212,7 @@ jobs: continue-on-error: ${{ matrix.experimental }} env: workdir: '${{ github.workspace }}' - CHANNELS: -c intel -c conda-forge --override-channels + CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels steps: - name: Download artifact @@ -271,7 +271,7 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - name: Install opencl_rt shell: cmd /C CALL {0} - run: conda install -n dpctl_test opencl_rt -c intel --override-channels + run: conda install -n dpctl_test opencl_rt -c intel/label/validation -c intel --override-channels - name: Install dpctl shell: cmd /C CALL {0} run: | @@ -432,7 +432,7 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel -c conda-forge --override-channels + CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels steps: - name: Install conda-build @@ -490,7 +490,7 @@ jobs: shell: bash -l {0} run: | source $CONDA/etc/profile.d/conda.sh - CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels" + CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel/label/validation -c intel -c conda-forge --override-channels" export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}") conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1 - name: Build and run examples of pybind11 extensions @@ -575,7 +575,7 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel -c conda-forge --override-channels + CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels steps: - name: Cache array API tests id: cache-array-api-tests From 217fc2689415484ce6dc81ded28890e0026f6084 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 06:59:36 -0600 Subject: [PATCH 03/10] Use NumPy from bootstrap channel This work-around a problem where NumPy from intel channel installs dpcpp-cpp-rt from prior version of the compiler. --- .github/workflows/conda-package.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 7b1e8f3c95..a821b13bab 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -48,8 +48,9 @@ jobs: echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV - name: Build conda package run: | - CHANNELS="-c intel/label/validation -c intel -c conda-forge --override-channels" - VERSIONS="--python ${{ matrix.python }}" + # use bootstrap channel to pull NumPy linked with OpenBLAS + CHANNELS="-c dppy/label/bootstrap -c intel/label/validation -c intel -c conda-forge --override-channels" + VERSIONS="--python ${{ matrix.python }} --numpy 1.23" TEST="--no-test" conda build \ $TEST \ From 8c84e2a5f55003267bd19ed618e8b2d15e6cb19e Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 08:26:06 -0600 Subject: [PATCH 04/10] Adapt scripts to change in compiler layout --- scripts/gen_coverage.py | 4 ++-- scripts/gen_docs.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/gen_coverage.py b/scripts/gen_coverage.py index 93328f1b85..5888b0f6c4 100644 --- a/scripts/gen_coverage.py +++ b/scripts/gen_coverage.py @@ -195,8 +195,8 @@ def find_objects(): args.cxx_compiler = "icpx" args.compiler_root = None icx_path = subprocess.check_output(["which", "icx"]) - bin_dir = os.path.dirname(os.path.dirname(icx_path)) - args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "bin-llvm") + bin_dir = os.path.dirname(icx_path) + args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "compiler") else: args_to_validate = [ "c_compiler", diff --git a/scripts/gen_docs.py b/scripts/gen_docs.py index 9e2285a477..e99dc74a52 100644 --- a/scripts/gen_docs.py +++ b/scripts/gen_docs.py @@ -134,8 +134,8 @@ def run( args.cxx_compiler = "icpx" args.compiler_root = None icx_path = subprocess.check_output(["which", "icx"]) - bin_dir = os.path.dirname(os.path.dirname(icx_path)) - args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "bin-llvm") + bin_dir = os.path.dirname(icx_path) + args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "compiler") else: args_to_validate = [ "c_compiler", From 500f759edecf30bce6d9dafb8934bc072584363f Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 11:15:10 -0600 Subject: [PATCH 05/10] Use newer version of checkout action to use Node 16 --- .github/workflows/conda-package.yml | 60 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index a821b13bab..8ef05d63c5 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -393,36 +393,6 @@ jobs: ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} run: anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.whl --version ${{ env.PACKAGE_VERSION }} - cleanup_packages: - name: Clean up anaconda packages - needs: [upload_linux, upload_windows] - runs-on: 'ubuntu-latest' - defaults: - run: - shell: bash -el {0} - steps: - - uses: conda-incubator/setup-miniconda@v2 - with: - run-post: false - channel-priority: "disabled" - channels: conda-forge - python-version: '3.11' - - - name: Install anaconda-client - run: conda install anaconda-client - - - name: Checkout repo - uses: actions/checkout@v2 - with: - repository: IntelPython/devops-tools - fetch-depth: 0 - - - name: Cleanup old packages - run: | - python scripts/cleanup-old-packages.py \ - --verbose --force --token ${{ secrets.ANACONDA_TOKEN }} \ - --package dppy/${{ env.PACKAGE_NAME }} --label dev - test_examples_linux: needs: build_linux runs-on: ${{ matrix.runner }} @@ -700,3 +670,33 @@ jobs: allow-repeats: true repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token-user-login: 'github-actions[bot]' + + cleanup_packages: + name: Clean up anaconda packages + needs: [upload_linux, upload_windows] + runs-on: 'ubuntu-latest' + defaults: + run: + shell: bash -el {0} + steps: + - uses: conda-incubator/setup-miniconda@v2 + with: + run-post: false + channel-priority: "disabled" + channels: conda-forge + python-version: '3.11' + + - name: Install anaconda-client + run: conda install anaconda-client + + - name: Checkout repo + uses: actions/checkout@v3 + with: + repository: IntelPython/devops-tools + fetch-depth: 0 + + - name: Cleanup old packages + run: | + python scripts/cleanup-old-packages.py \ + --verbose --force --token ${{ secrets.ANACONDA_TOKEN }} \ + --package dppy/${{ env.PACKAGE_NAME }} --label dev From 471f6e1aa622232cf34706ef5713b80a60b09aba Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 11:17:28 -0600 Subject: [PATCH 06/10] Pin DPC++ compiler to 2023.2.1 to work around a crash in 2024.0 --- .github/workflows/generate-coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-coverage.yaml b/.github/workflows/generate-coverage.yaml index 7e0c8b8667..e9053797f3 100644 --- a/.github/workflows/generate-coverage.yaml +++ b/.github/workflows/generate-coverage.yaml @@ -29,8 +29,8 @@ jobs: - name: Install Intel OneAPI run: | - sudo apt-get install intel-oneapi-compiler-dpcpp-cpp - sudo apt-get install intel-oneapi-tbb + sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-2023.2.1 + sudo apt-get install intel-oneapi-tbb-2021.10.0 - name: Install CMake and Ninja run: | From b814f5316916d9704f1d45f3e37133a77743e27f Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 13:18:31 -0600 Subject: [PATCH 07/10] Coverage action to run on DPC++ 2023.2.1 --- .github/workflows/generate-coverage.yaml | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-coverage.yaml b/.github/workflows/generate-coverage.yaml index e9053797f3..a8c626faba 100644 --- a/.github/workflows/generate-coverage.yaml +++ b/.github/workflows/generate-coverage.yaml @@ -12,6 +12,8 @@ jobs: env: ONEAPI_ROOT: /opt/intel/oneapi GTEST_ROOT: /home/runner/work/googletest-1.13.0/install + # Use oneAPI compiler 2023 to work around an issue + USE_2023: 1 steps: - name: Cancel Previous Runs @@ -27,11 +29,18 @@ jobs: sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" sudo apt-get update - - name: Install Intel OneAPI + - name: Install Intel OneAPI 2023 + if: env.USE_2023 == '1' run: | sudo apt-get install intel-oneapi-compiler-dpcpp-cpp-2023.2.1 sudo apt-get install intel-oneapi-tbb-2021.10.0 + - name: Install latest Intel OneAPI + if: env.USE_2023 != '1' + run: | + sudo apt-get install intel-oneapi-compiler-dpcpp-cpp + sudo apt-get install intel-oneapi-tbb + - name: Install CMake and Ninja run: | sudo apt-get install ninja-build @@ -81,7 +90,19 @@ jobs: run: | pip install numpy"<1.26.0" cython setuptools pytest pytest-cov scikit-build cmake coverage[toml] - - name: Build dpctl with coverage + - name: Build dpctl with coverage for oneAPI 2023 + if: env.USE_2023 == '1' + shell: bash -l {0} + run: | + source /opt/intel/oneapi/setvars.sh + export ARGS="--not-oneapi --compiler-root ${CMPLR_ROOT}" + export ARGS="${ARGS} --c-compiler ${CMPLR_ROOT}/linux/bin/icx" + export ARGS="${ARGS} --cxx-compiler ${CMPLR_ROOT}/linux/bin/icpx" + export ARGS="${ARGS} --bin-llvm ${CMPLR_ROOT}/linux/bin-llvm" + python scripts/gen_coverage.py ${ARGS} + + - name: Build dpctl with coverage for default oneAPI + if: env.USE_2023 != '1' shell: bash -l {0} run: | source /opt/intel/oneapi/setvars.sh From ae0c6ccccbe03c9085a57ff5a8d43b5858047c28 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 15:26:14 -0600 Subject: [PATCH 08/10] gen_coverage can deal with both 2024 and 2023 layouts --- scripts/gen_coverage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/gen_coverage.py b/scripts/gen_coverage.py index 5888b0f6c4..538b93adbb 100644 --- a/scripts/gen_coverage.py +++ b/scripts/gen_coverage.py @@ -196,7 +196,13 @@ def find_objects(): args.compiler_root = None icx_path = subprocess.check_output(["which", "icx"]) bin_dir = os.path.dirname(icx_path) - args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "compiler") + compiler_dir = os.path.join(bin_dir.decode("utf-8"), "compiler") + if os.path.exists(compiler_dir): + args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "compiler") + else: + bin_dir = os.path.dirname(bin_dir) + args.bin_llvm = os.path.join(bin_dir.decode("utf-8"), "bin-llvm") + assert os.path.exists(args.bin_llvm) else: args_to_validate = [ "c_compiler", From e46bbd743ab4bcfd7a82f0ae27d8ec7e042748bf Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 15 Nov 2023 15:26:31 -0600 Subject: [PATCH 09/10] Coalesce two steps now that gen_coverage can handle both layouts --- .github/workflows/generate-coverage.yaml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/generate-coverage.yaml b/.github/workflows/generate-coverage.yaml index a8c626faba..d739e32ad7 100644 --- a/.github/workflows/generate-coverage.yaml +++ b/.github/workflows/generate-coverage.yaml @@ -90,19 +90,7 @@ jobs: run: | pip install numpy"<1.26.0" cython setuptools pytest pytest-cov scikit-build cmake coverage[toml] - - name: Build dpctl with coverage for oneAPI 2023 - if: env.USE_2023 == '1' - shell: bash -l {0} - run: | - source /opt/intel/oneapi/setvars.sh - export ARGS="--not-oneapi --compiler-root ${CMPLR_ROOT}" - export ARGS="${ARGS} --c-compiler ${CMPLR_ROOT}/linux/bin/icx" - export ARGS="${ARGS} --cxx-compiler ${CMPLR_ROOT}/linux/bin/icpx" - export ARGS="${ARGS} --bin-llvm ${CMPLR_ROOT}/linux/bin-llvm" - python scripts/gen_coverage.py ${ARGS} - - - name: Build dpctl with coverage for default oneAPI - if: env.USE_2023 != '1' + - name: Build dpctl with coverage shell: bash -l {0} run: | source /opt/intel/oneapi/setvars.sh From 3a1399a6a836b5d68b1346f717e2d69f66ca598e Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 16 Nov 2023 13:53:33 -0600 Subject: [PATCH 10/10] Remove intel/label/validation since packages were promoted --- .github/workflows/conda-package.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 8ef05d63c5..2bde4d7ccb 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -49,7 +49,7 @@ jobs: - name: Build conda package run: | # use bootstrap channel to pull NumPy linked with OpenBLAS - CHANNELS="-c dppy/label/bootstrap -c intel/label/validation -c intel -c conda-forge --override-channels" + CHANNELS="-c dppy/label/bootstrap -c intel -c conda-forge --override-channels" VERSIONS="--python ${{ matrix.python }} --numpy 1.23" TEST="--no-test" conda build \ @@ -105,7 +105,7 @@ jobs: - name: Build conda package env: OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides - run: conda build --no-test --python ${{ matrix.python }} -c intel/label/validation -c intel -c conda-forge --override-channels conda-recipe + run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe - name: Upload artifact uses: actions/upload-artifact@v3 with: @@ -128,7 +128,7 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels + CHANNELS: -c intel -c conda-forge --override-channels steps: - name: Download artifact @@ -213,7 +213,7 @@ jobs: continue-on-error: ${{ matrix.experimental }} env: workdir: '${{ github.workspace }}' - CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels + CHANNELS: -c intel -c conda-forge --override-channels steps: - name: Download artifact @@ -272,7 +272,7 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - name: Install opencl_rt shell: cmd /C CALL {0} - run: conda install -n dpctl_test opencl_rt -c intel/label/validation -c intel --override-channels + run: conda install -n dpctl_test opencl_rt -c intel --override-channels - name: Install dpctl shell: cmd /C CALL {0} run: | @@ -403,7 +403,7 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels + CHANNELS: -c intel -c conda-forge --override-channels steps: - name: Install conda-build @@ -461,7 +461,7 @@ jobs: shell: bash -l {0} run: | source $CONDA/etc/profile.d/conda.sh - CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel/label/validation -c intel -c conda-forge --override-channels" + CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels" export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}") conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1 - name: Build and run examples of pybind11 extensions @@ -546,7 +546,7 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel/label/validation -c intel -c conda-forge --override-channels + CHANNELS: -c intel -c conda-forge --override-channels steps: - name: Cache array API tests id: cache-array-api-tests