Skip to content

simplify backend implementation of dpnp.kaiser #1618

simplify backend implementation of dpnp.kaiser

simplify backend implementation of dpnp.kaiser #1618

name: Test oneMKL interfaces
on:
push:
branches:
- master
pull_request:
permissions: read-all
env:
environment-file: 'environments/environment.yml'
environment-file-name: 'environment.yml'
environment-file-loc: '${{ github.workspace }}/environments'
build-with-oneapi-env: 'environments/build_with_oneapi.yml'
dpctl-pkg-env: 'environments/dpctl_pkg.yml'
oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'
test-env-name: 'test_onemkl_interfaces'
rerun-tests-on-failure: 'true'
rerun-tests-max-attempts: 2
rerun-tests-timeout: 20
jobs:
build_env_file:
name: Build conda env file
permissions:
# Needed to cancel any previous runs that are not completed for a given workflow
actions: write
runs-on: 'ubuntu-latest'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout DPNP repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install conda-merge tool
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
with:
packages: conda-merge
- name: Merge conda env files
run: |
conda-merge ${{ env.dpctl-pkg-env }} ${{ env.oneapi-pkgs-env }} ${{ env.build-with-oneapi-env }} > ${{ env.environment-file }}
cat ${{ env.environment-file }}
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.environment-file-name }}
path: ${{ env.environment-file }}
test_by_tag:
name: Run tests with oneMKL tag
needs: build_env_file
strategy:
fail-fast: false
matrix:
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
python: ['3.12']
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.os == 'windows-2022' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
steps:
- name: Checkout DPNP repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ${{ env.environment-file-name }}
path: ${{ env.environment-file-loc }}
- name: Setup miniconda
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: ReSetup miniconda
if: steps.setup_miniconda.outcome == 'failure'
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: Conda info
run: |
mamba info
mamba list
- name: Build and install DPNP package
run: |
python scripts/build_locally.py --onemkl-interfaces --verbose
- name: Smoke test
run: |
python -m dpctl -f
python -c "import dpnp; print(dpnp.__version__)"
- name: Run tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
env:
SYCL_CACHE_PERSISTENT: 1
- name: ReRun tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
command: |
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}
python -m pytest -ra --pyargs dpnp.tests
env:
SYCL_CACHE_PERSISTENT: 1
test_by_branch:
name: Run tests with oneMKL develop branch
needs: build_env_file
strategy:
fail-fast: false
matrix:
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
python: ['3.12']
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.os == 'windows-2022' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
env:
onemkl-source-dir: '${{ github.workspace }}/onemkl/'
steps:
- name: Checkout DPNP repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: ${{ env.environment-file-name }}
path: ${{ env.environment-file-loc }}
- name: Checkout oneMKL repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: 'oneapi-src/oneMKL'
ref: 'develop'
path: ${{ env.onemkl-source-dir }}
fetch-depth: 0
- name: oneMKL ls info
run: |
ls -la ${{ env.onemkl-source-dir }}
- name: Setup miniconda
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: ReSetup miniconda
if: steps.setup_miniconda.outcome == 'failure'
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: Conda info
run: |
mamba info
mamba list
- name: Build and install DPNP package
run: |
python scripts/build_locally.py --onemkl-interfaces --onemkl-interfaces-dir=${{ env.onemkl-source-dir }} --verbose
- name: Smoke test
run: |
python -m dpctl -f
python -c "import dpnp; print(dpnp.__version__)"
- name: Run tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
env:
SYCL_CACHE_PERSISTENT: 1
- name: ReRun tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-tests-max-attempts }}
retry_on: any
command: |
. $CONDA/etc/profile.d/conda.sh
. $CONDA/etc/profile.d/mamba.sh
mamba activate ${{ env.test-env-name }}
python -m pytest -ra --pyargs dpnp.tests
env:
SYCL_CACHE_PERSISTENT: 1