Skip to content
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

Selective CI based on changes to a domain #504

Closed
wants to merge 13 commits into from
Closed
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
58 changes: 44 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,28 @@ jobs:
matrix:
include:
- config: portBLAS
options: -DTARGET_DOMAINS=blas -DREF_BLAS_ROOT=${PWD}/lapack/install -DENABLE_PORTBLAS_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DPORTBLAS_TUNING_TARGET=INTEL_CPU
tests: '.*'
domain: blas
exclude: lapack|dft|rng
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install -DENABLE_PORTBLAS_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DPORTBLAS_TUNING_TARGET=INTEL_CPU
- config: portFFT
options: -DENABLE_PORTFFT_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DTARGET_DOMAINS=dft -DCMAKE_CXX_FLAGS="-fsycl -fsycl-targets=spir64"
tests: 'DFT/CT/.*ComputeTests_in_place_COMPLEX.COMPLEX_SINGLE_in_place_buffer.sizes_8_batches_1*'
domain: dft
exclude: blas|lapack|rng
build_options: -DENABLE_PORTFFT_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DCMAKE_CXX_FLAGS="-fsycl -fsycl-targets=spir64"
test_options: -R 'DFT/CT/.*ComputeTests_in_place_COMPLEX.COMPLEX_SINGLE_in_place_buffer.sizes_8_batches_1*'
- config: MKL BLAS
options: -DTARGET_DOMAINS=blas -DREF_BLAS_ROOT=${PWD}/lapack/install
tests: '.*'
domain: blas
exclude: lapack|dft|rng
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install
- config: MKL DFT
options: -DTARGET_DOMAINS=dft
tests: '.*'
domain: dft
exclude: blas|lapack|rng
- config: MKL LAPACK
options: -DTARGET_DOMAINS=lapack -DREF_LAPACK_ROOT=${PWD}/lapack/install
tests: '.*'
domain: lapack
exclude: blas|dft|rng
build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install
- config: MKL RNG
options: -DTARGET_DOMAINS=rng
tests: '.*'
domain: rng
exclude: blas|dft|lapack
name: unit tests ${{ matrix.config }} CPU
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
Expand All @@ -58,18 +63,43 @@ jobs:
# 64 bit int
cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64
cmake --build lapack/build64 ${PARALLEL} --target install
- name: Test if the changes affect this domain
id: test_domain
uses: actions/github-script@v4
with:
script: |
function matchesPattern(filePaths) {
console.log('files:', filePaths)
const dirs = '(examples|src|include/oneapi/mkl)'
const domains = '(blas|lapack|rng|dft)'
const domain = '${{ matrix.domain }}'
// matches the domain we want or no domain at all
const re = new RegExp(`^(${dirs}/${domain}|(?!${dirs}/${domains}))`);
return filePaths.some(filePath => re.test(filePath));
}
const pr = context.payload.pull_request
const compare = await github.rest.repos.compareCommits({
owner: context.repo.owner,
repo: context.repo.repo,
base: pr.base.sha,
head: pr.head.sha
});
return matchesPattern(compare.data.files.map((f) => f.filename));
- name: Install oneapi
if: steps.test_domain.outputs.result == 'true'
uses: rscohn2/setup-oneapi@2ad0cf6b74bc2426bdcee825cf88f9db719dd727 # v0.1.0
with:
components: |
icx@2024.1.0
mkl@2024.1.0
- name: Configure/Build for a domain
if: steps.test_domain.outputs.result == 'true'
run: |
source /opt/intel/oneapi/setvars.sh
cmake -DENABLE_MKLGPU_BACKEND=off -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.options }} -B build
cmake -DTARGET_DOMAINS=${{ matrix.domain }} -DENABLE_MKLGPU_BACKEND=off -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.build_options }} -B build
cmake --build build ${PARALLEL}
- name: Run tests
if: steps.test_domain.outputs.result == 'true'
run: |
source /opt/intel/oneapi/setvars.sh
ctest --test-dir build -R ${{ matrix.tests }}
ctest --test-dir build ${{ matrix.test_options }}
1 change: 1 addition & 0 deletions src/blas/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# test change
#===============================================================================
# Copyright 2020-2021 Intel Corporation
#
Expand Down
Loading