From 54055093b738957e50c81dbe9b0c451394fbcbe6 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 06:34:16 -0500 Subject: [PATCH 01/13] Selective CI basecd on changes to a domain --- .github/workflows/pr.yml | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7c22d384f..6abd7be30 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,31 +16,41 @@ env: jobs: unit-tests: runs-on: ubuntu-latest + if: steps.changes.outputs.src == 'true' # One runner for each domain strategy: 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 + 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 + 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 + build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install - config: MKL DFT - options: -DTARGET_DOMAINS=dft - tests: '.*' + domain: dft - config: MKL LAPACK - options: -DTARGET_DOMAINS=lapack -DREF_LAPACK_ROOT=${PWD}/lapack/install - tests: '.*' + domain: lapack + build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install - config: MKL RNG - options: -DTARGET_DOMAINS=rng - tests: '.*' + domain: rng name: unit tests ${{ matrix.config }} CPU steps: - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + - name: Check for changes to this domain + id: changes + uses: dorny/paths-filter@v2 + with: + filters: | + src: + - 'src/${{ matrix.domain}}/**' + - 'tests/unit_tests/${{ matrix.domain }}/**' + - CMakeLists.txt + # - '.github/workflows/**' - name: Restore netlib from cache id: cache-lapack uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -64,12 +74,13 @@ jobs: components: | icx@2024.1.0 mkl@2024.1.0 + - name: Configure/Build for a domain 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 run: | source /opt/intel/oneapi/setvars.sh - ctest --test-dir build -R ${{ matrix.tests }} + ctest --test-dir build ${{ matrix.test_options }} From d11ee882508d5cc6087905e51c995b3b614e19b3 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 06:43:10 -0500 Subject: [PATCH 02/13] update --- .github/workflows/pr.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6abd7be30..a503de6d7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,7 +16,6 @@ env: jobs: unit-tests: runs-on: ubuntu-latest - if: steps.changes.outputs.src == 'true' # One runner for each domain strategy: matrix: @@ -41,16 +40,6 @@ jobs: name: unit tests ${{ matrix.config }} CPU steps: - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - - name: Check for changes to this domain - id: changes - uses: dorny/paths-filter@v2 - with: - filters: | - src: - - 'src/${{ matrix.domain}}/**' - - 'tests/unit_tests/${{ matrix.domain }}/**' - - CMakeLists.txt - # - '.github/workflows/**' - name: Restore netlib from cache id: cache-lapack uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -68,19 +57,31 @@ jobs: # 64 bit int cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64 cmake --build lapack/build64 ${PARALLEL} --target install + - name: Check for changes to this domain + id: changes + uses: dorny/paths-filter@v2 + with: + filters: | + src: + - 'src/${{ matrix.domain}}/**' + - 'tests/unit_tests/${{ matrix.domain }}/**' + - CMakeLists.txt + # - '.github/workflows/**' - name: Install oneapi + if: needs.check_changes.outputs.src == '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: needs.check_changes.outputs.src == 'true' run: | source /opt/intel/oneapi/setvars.sh 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: needs.check_changes.outputs.src == 'true' run: | source /opt/intel/oneapi/setvars.sh ctest --test-dir build ${{ matrix.test_options }} From e8766fa29d316c83c30ecb5da5a6e2981774c05a Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 07:36:06 -0500 Subject: [PATCH 03/13] test change to dft --- src/dft/DO_NOT_COMMIT.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/dft/DO_NOT_COMMIT.txt diff --git a/src/dft/DO_NOT_COMMIT.txt b/src/dft/DO_NOT_COMMIT.txt new file mode 100644 index 000000000..e69de29bb From 30c14672d24ea0f222aa5af176199e0080229623 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 07:44:12 -0500 Subject: [PATCH 04/13] udpate --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a503de6d7..6f7118ae4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,7 @@ env: jobs: unit-tests: - runs-on: ubuntu-latest + runs-on: intel-ubuntu-latest # One runner for each domain strategy: matrix: @@ -59,7 +59,7 @@ jobs: cmake --build lapack/build64 ${PARALLEL} --target install - name: Check for changes to this domain id: changes - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 with: filters: | src: From a72a0e845639a69c6f30541fb5b0a1627f5609c5 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 07:55:05 -0500 Subject: [PATCH 05/13] update --- .github/workflows/pr.yml | 6 +++--- tests/unit_tests/rng/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6f7118ae4..4cfd0a30c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -68,20 +68,20 @@ jobs: - CMakeLists.txt # - '.github/workflows/**' - name: Install oneapi - if: needs.check_changes.outputs.src == 'true' + if: steps.changes.outputs.src == '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: needs.check_changes.outputs.src == 'true' + if: steps.changes.outputs.src == 'true' run: | source /opt/intel/oneapi/setvars.sh 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: needs.check_changes.outputs.src == 'true' + if: steps.changes.outputs.src == 'true' run: | source /opt/intel/oneapi/setvars.sh ctest --test-dir build ${{ matrix.test_options }} diff --git a/tests/unit_tests/rng/CMakeLists.txt b/tests/unit_tests/rng/CMakeLists.txt index a2f077d35..da67da8b6 100644 --- a/tests/unit_tests/rng/CMakeLists.txt +++ b/tests/unit_tests/rng/CMakeLists.txt @@ -1,3 +1,4 @@ +# Do not commit #=============================================================================== # Copyright 2020-2021 Intel Corporation # From 15b132019082566a17e9ab00abfbdd0d0d531b2f Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 07:56:17 -0500 Subject: [PATCH 06/13] update --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4cfd0a30c..ad0ea115e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -75,7 +75,7 @@ jobs: icx@2024.1.0 mkl@2024.1.0 - name: Configure/Build for a domain - if: steps.changes.outputs.src == 'true' + if: steps.changes.outputs.src == 'true' run: | source /opt/intel/oneapi/setvars.sh cmake -DTARGET_DOMAINS=${{ matrix.domain }} -DENABLE_MKLGPU_BACKEND=off -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.build_options }} -B build From aa6debc0bd43daf0fe9fae301b4df68e4bfc8fe7 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Fri, 31 May 2024 08:04:30 -0500 Subject: [PATCH 07/13] update --- .github/workflows/pr.yml | 4 ++-- src/dft/DO_NOT_COMMIT.txt | 0 tests/unit_tests/rng/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 src/dft/DO_NOT_COMMIT.txt diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ad0ea115e..99c062831 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,7 @@ env: jobs: unit-tests: - runs-on: intel-ubuntu-latest + runs-on: ubuntu-latest # One runner for each domain strategy: matrix: @@ -66,7 +66,7 @@ jobs: - 'src/${{ matrix.domain}}/**' - 'tests/unit_tests/${{ matrix.domain }}/**' - CMakeLists.txt - # - '.github/workflows/**' + - '.github/workflows/**' - name: Install oneapi if: steps.changes.outputs.src == 'true' uses: rscohn2/setup-oneapi@2ad0cf6b74bc2426bdcee825cf88f9db719dd727 # v0.1.0 diff --git a/src/dft/DO_NOT_COMMIT.txt b/src/dft/DO_NOT_COMMIT.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/unit_tests/rng/CMakeLists.txt b/tests/unit_tests/rng/CMakeLists.txt index da67da8b6..a2f077d35 100644 --- a/tests/unit_tests/rng/CMakeLists.txt +++ b/tests/unit_tests/rng/CMakeLists.txt @@ -1,4 +1,3 @@ -# Do not commit #=============================================================================== # Copyright 2020-2021 Intel Corporation # From 69afc834902baf2644c827f75ecd4f0f892ec900 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Sat, 1 Jun 2024 08:03:17 -0400 Subject: [PATCH 08/13] apply review suggestion Co-authored-by: Dai-Ni Hsieh --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 99c062831..f2a48dc16 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -63,7 +63,7 @@ jobs: with: filters: | src: - - 'src/${{ matrix.domain}}/**' + - 'src/${{ matrix.domain }}/**' - 'tests/unit_tests/${{ matrix.domain }}/**' - CMakeLists.txt - '.github/workflows/**' From 3a90e5ec453bf8b367215ab7554bd2fb0290bc00 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Tue, 4 Jun 2024 14:58:37 -0500 Subject: [PATCH 09/13] precise filter --- .github/workflows/pr.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f2a48dc16..8f38f245e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,21 +22,27 @@ jobs: include: - config: portBLAS 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 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 domain: blas + exclude: lapack|dft|rng build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install - config: MKL DFT domain: dft + exclude: blas|lapack|rng - config: MKL LAPACK domain: lapack + exclude: blas|dft|rng build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install - config: MKL RNG domain: rng + exclude: blas|dft|lapack name: unit tests ${{ matrix.config }} CPU steps: - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 @@ -61,12 +67,14 @@ jobs: id: changes uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 with: + list-files: shell filters: | src: - - 'src/${{ matrix.domain }}/**' - - 'tests/unit_tests/${{ matrix.domain }}/**' - - CMakeLists.txt - - '.github/workflows/**' + # match everything + - '**' + # exclude other domains + - '!src/${{ matrix.exclude }}/**' + - '!tests/unit_tests/${{ matrix.exclude }}/**' - name: Install oneapi if: steps.changes.outputs.src == 'true' uses: rscohn2/setup-oneapi@2ad0cf6b74bc2426bdcee825cf88f9db719dd727 # v0.1.0 From 92e672a0c63f526daaf5dbb81cc7351115c577ca Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Tue, 4 Jun 2024 15:01:34 -0500 Subject: [PATCH 10/13] test --- src/blas/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 1edf2e445..3a6d1a50b 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -1,3 +1,4 @@ +# test change #=============================================================================== # Copyright 2020-2021 Intel Corporation # From caaca623ec9bc9d4262f6cbe05913c9798f013c6 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Tue, 4 Jun 2024 15:33:51 -0500 Subject: [PATCH 11/13] test --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8f38f245e..dc07fa900 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -68,6 +68,7 @@ jobs: uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 with: list-files: shell + predicate-quantifier: every filters: | src: # match everything From 45ba074db14dab0a23a60b248cdc090c15531f9c Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Tue, 4 Jun 2024 15:43:28 -0500 Subject: [PATCH 12/13] test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index dc07fa900..111e7780e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -66,9 +66,9 @@ jobs: - name: Check for changes to this domain id: changes uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + predicate-quantifier: every with: list-files: shell - predicate-quantifier: every filters: | src: # match everything From d6a5ae437e837a13fe1630d42db1c4b9c9990738 Mon Sep 17 00:00:00 2001 From: Robert Cohn Date: Wed, 5 Jun 2024 09:36:32 -0500 Subject: [PATCH 13/13] test --- .github/workflows/pr.yml | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 111e7780e..dc4488a45 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -63,34 +63,43 @@ jobs: # 64 bit int cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64 cmake --build lapack/build64 ${PARALLEL} --target install - - name: Check for changes to this domain - id: changes - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - predicate-quantifier: every + - name: Test if the changes affect this domain + id: test_domain + uses: actions/github-script@v4 with: - list-files: shell - filters: | - src: - # match everything - - '**' - # exclude other domains - - '!src/${{ matrix.exclude }}/**' - - '!tests/unit_tests/${{ matrix.exclude }}/**' + 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.changes.outputs.src == 'true' + 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.changes.outputs.src == 'true' + if: steps.test_domain.outputs.result == 'true' run: | source /opt/intel/oneapi/setvars.sh 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.changes.outputs.src == 'true' + if: steps.test_domain.outputs.result == 'true' run: | source /opt/intel/oneapi/setvars.sh ctest --test-dir build ${{ matrix.test_options }}