diff --git a/.github/workflows/sycl_gen_test_matrix.yml b/.github/workflows/sycl_gen_test_matrix.yml index 9b31eb215ece3..6ec15777559b4 100644 --- a/.github/workflows/sycl_gen_test_matrix.yml +++ b/.github/workflows/sycl_gen_test_matrix.yml @@ -34,21 +34,25 @@ on: required: false default: ${{ github.sha }} outputs: - lts_matrix: - description: "Generated Matrix" - value: ${{ jobs.test_matrix.outputs.lts_matrix }} + lts_lx_matrix: + description: "Generated Linux LTS Matrix" + value: ${{ jobs.test_matrix.outputs.lts_lx_matrix }} + lts_wn_matrix: + description: "Generated Windows LTS Matrix" + value: ${{ jobs.test_matrix.outputs.lts_wn_matrix }} cts_matrix: description: "Generated SYCL CTS Matrix" value: ${{ jobs.test_matrix.outputs.cts_matrix }} lts_aws_matrix: - description: "Generated Matrix AWS subset" + description: "Generated Linux AWS Matrix" value: ${{ jobs.test_matrix.outputs.lts_aws_matrix }} jobs: test_matrix: name: Generate Test Matrix runs-on: ubuntu-latest outputs: - lts_matrix: ${{ steps.work.outputs.lts_matrix }} + lts_lx_matrix: ${{ steps.work.outputs.lts_lx_matrix }} + lts_wn_matrix: ${{ steps.work.outputs.lts_wn_matrix }} cts_matrix: ${{ steps.work.outputs.cts_matrix }} lts_aws_matrix: ${{ steps.work.outputs.lts_aws_matrix }} steps: diff --git a/.github/workflows/sycl_post_commit.yml b/.github/workflows/sycl_post_commit.yml index c149effcb2e52..f861ca7fd40a1 100644 --- a/.github/workflows/sycl_post_commit.yml +++ b/.github/workflows/sycl_post_commit.yml @@ -21,105 +21,109 @@ jobs: name: Generate Test Matrix uses: ./.github/workflows/sycl_gen_test_matrix.yml with: - lts_config: "l0_gen9" - cts_config: "cuda" - linux_default: - name: Linux Default - needs: test_matrix - uses: ./.github/workflows/sycl_linux_build_and_test.yml - secrets: inherit - with: - build_cache_root: "/__w/llvm" - build_artifact_suffix: "post_commit" - lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }} - cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }} - lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }} - linux_no_assert: - name: Linux (no assert) - uses: ./.github/workflows/sycl_linux_build_and_test.yml - secrets: inherit - with: - build_cache_root: "/__w/llvm" - build_cache_suffix: gcc_no_assertions - build_artifact_suffix: gcc_no_assertions - build_configure_extra_args: --no-assertions - linux_clang_shared_libs: - # TODO use nightly images when Docker containers are available - name: Linux + Clang + Shared libs - runs-on: ubuntu-20.04 - if: github.repository == 'intel/llvm' - steps: - - uses: actions/checkout@v3 - with: - path: src - - name: Install Ubuntu deps - run: sudo apt install -y ninja-build ccache - - name: Setup Cache - uses: actions/cache@v3 - id: cache - with: - path: ${{ github.workspace }}/cache - key: build-linux-shared-libs-${{ github.sha }} - restore-keys: | - build-linux-shared-libs- - - name: Configure - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" - sudo apt-get update - sudo apt-get install -y clang-15 - export CC="clang-15" - export CXX="clang++-15" - mkdir -p $GITHUB_WORKSPACE/build - cd $GITHUB_WORKSPACE/build - python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \ - --ci-defaults --shared-libs --cmake-opt="-DLLVM_CCACHE_BUILD=ON" \ - --cmake-opt="-DLLVM_CCACHE_DIR=$GITHUB_WORKSPACE/cache" \ - --cmake-opt="-DLLVM_CCACHE_MAXSIZE=2G" - - name: Compile - run: | - python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build - - name: check-llvm - if: always() - run: | - python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm - - name: check-clang - if: always() - run: | - python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-clang - - name: check-sycl - if: always() - run: | - python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-sycl - - name: check-llvm-spirv - if: always() - run: | - python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm-spirv - - name: check-xptifw - if: always() - run: | - python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-xptifw - - name: Pack - run: tar -czvf llvm_sycl.tar.gz -C $GITHUB_WORKSPACE/build/install . - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: sycl_linux_${{ matrix.config }} - path: llvm_sycl.tar.gz + lts_config: "win_l0_gen9" +# lts_config: "l0_gen9;win_l0_gen9" +# cts_config: "cuda" +# linux_default: +# name: Linux Default +# needs: test_matrix +# uses: ./.github/workflows/sycl_linux_build_and_test.yml +# secrets: inherit +# with: +# build_cache_root: "/__w/llvm" +# build_artifact_suffix: "post_commit" +# lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }} +# cts_matrix: ${{ needs.test_matrix.outputs.cts_matrix }} +# lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }} +# linux_no_assert: +# name: Linux (no assert) +# uses: ./.github/workflows/sycl_linux_build_and_test.yml +# secrets: inherit +# with: +# build_cache_root: "/__w/llvm" +# build_cache_suffix: gcc_no_assertions +# build_artifact_suffix: gcc_no_assertions +# build_configure_extra_args: --no-assertions +# linux_clang_shared_libs: +# # TODO use nightly images when Docker containers are available +# name: Linux + Clang + Shared libs +# runs-on: ubuntu-20.04 +# if: github.repository == 'intel/llvm' +# steps: +# - uses: actions/checkout@v3 +# with: +# path: src +# - name: Install Ubuntu deps +# run: sudo apt install -y ninja-build ccache +# - name: Setup Cache +# uses: actions/cache@v3 +# id: cache +# with: +# path: ${{ github.workspace }}/cache +# key: build-linux-shared-libs-${{ github.sha }} +# restore-keys: | +# build-linux-shared-libs- +# - name: Configure +# run: | +# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - +# sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" +# sudo apt-get update +# sudo apt-get install -y clang-15 +# export CC="clang-15" +# export CXX="clang++-15" +# mkdir -p $GITHUB_WORKSPACE/build +# cd $GITHUB_WORKSPACE/build +# python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \ +# --ci-defaults --shared-libs --cmake-opt="-DLLVM_CCACHE_BUILD=ON" \ +# --cmake-opt="-DLLVM_CCACHE_DIR=$GITHUB_WORKSPACE/cache" \ +# --cmake-opt="-DLLVM_CCACHE_MAXSIZE=2G" +# - name: Compile +# run: | +# python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build +# - name: check-llvm +# if: always() +# run: | +# python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm +# - name: check-clang +# if: always() +# run: | +# python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-clang +# - name: check-sycl +# if: always() +# run: | +# python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-sycl +# - name: check-llvm-spirv +# if: always() +# run: | +# python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm-spirv +# - name: check-xptifw +# if: always() +# run: | +# python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \ +# -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-xptifw +# - name: Pack +# run: tar -czvf llvm_sycl.tar.gz -C $GITHUB_WORKSPACE/build/install . +# - name: Upload artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: sycl_linux_${{ matrix.config }} +# path: llvm_sycl.tar.gz windows_default: name: Windows + needs: test_matrix if: github.repository == 'intel/llvm' uses: ./.github/workflows/sycl_windows_build_and_test.yml + with: + lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }} - macos_default: - name: macOS - if: github.repository == 'intel/llvm' - uses: ./.github/workflows/sycl_macos_build_and_test.yml +# macos_default: +# name: macOS +# if: github.repository == 'intel/llvm' +# uses: ./.github/workflows/sycl_macos_build_and_test.yml diff --git a/.github/workflows/sycl_precommit.yml b/.github/workflows/sycl_precommit.yml index 8084284735cba..3dabc1ff83b3b 100644 --- a/.github/workflows/sycl_precommit.yml +++ b/.github/workflows/sycl_precommit.yml @@ -64,5 +64,5 @@ jobs: build_cache_size: "8G" build_artifact_suffix: "default" build_cache_suffix: "default" - lts_matrix: ${{ needs.test_matrix.outputs.lts_matrix }} + lts_matrix: ${{ needs.test_matrix.outputs.lts_lx_matrix }} lts_aws_matrix: ${{ needs.test_matrix.outputs.lts_aws_matrix }} diff --git a/.github/workflows/sycl_windows_build_and_test.yml b/.github/workflows/sycl_windows_build_and_test.yml index c995cee514429..0293426132292 100644 --- a/.github/workflows/sycl_windows_build_and_test.yml +++ b/.github/workflows/sycl_windows_build_and_test.yml @@ -10,6 +10,26 @@ on: build_ref: type: string required: false + lts_matrix: + type: string + required: false + default: "[]" + lts_aws_matrix: + type: string + required: false + default: "[]" + lts_cmake_extra_args: + type: string + required: false + default: "" + lts_ref: + type: string + required: false + default: 'intel' + max_parallel: + type: number + required: false + default: 4 jobs: build: @@ -50,34 +70,46 @@ jobs: --cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" - name: Build id: build + # TODO replace utility installation with a single CMake target run: | - cmake --build build --target sycl-toolchain + cmake --build build --target deploy-sycl-toolchain + cmake --build build --target utils/FileCheck/install + cmake --build build --target utils/count/install + cmake --build build --target utils/not/install + cmake --build build --target utils/lit/install + cmake --build build --target utils/llvm-lit/install + cmake --build build --target install-clang-format + cmake --build build --target install-clang-tidy + cmake --build build --target install-llvm-size + cmake --build build --target install-llvm-cov + cmake --build build --target install-llvm-profdata + cmake --build build --target install-compiler-rt sccache --show-stats - - name: check-llvm - shell: bash - if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} - run: | - cmake --build build --target check-llvm - - name: check-clang - if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} - shell: bash - run: | - cmake --build build --target check-clang - - name: check-sycl - if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} - shell: bash - run: | - cmake --build build --target check-sycl - - name: check-llvm-spirv - if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} - shell: bash - run: | - cmake --build build --target check-llvm-spirv - - name: check-xptifw - if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} - shell: bash - run: | - cmake --build build --target check-xptifw +# - name: check-llvm +# shell: bash +# if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} +# run: | +# cmake --build build --target check-llvm +# - name: check-clang +# if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} +# shell: bash +# run: | +# cmake --build build --target check-clang +# - name: check-sycl +# if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} +# shell: bash +# run: | +# cmake --build build --target check-sycl +# - name: check-llvm-spirv +# if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} +# shell: bash +# run: | +# cmake --build build --target check-llvm-spirv +# - name: check-xptifw +# if: ${{ always() && !cancelled() && steps.build.outcome == 'success' }} +# shell: bash +# run: | +# cmake --build build --target check-xptifw - name: Install shell: bash run: cmake --build build --target deploy-sycl-toolchain @@ -85,4 +117,41 @@ jobs: uses: actions/upload-artifact@v3 with: name: sycl_windows_default - path: install/**/* + path: install + - name: Upload LIT + uses: actions/upload-artifact@v3 + with: + name: sycl_windows_lit + path: src/llvm/utils/lit + + llvm_test_suite: + needs: build + if: ${{ !failure() && inputs.lts_matrix != '[]' }} + strategy: + fail-fast: false + max-parallel: ${{ inputs.max_parallel }} + matrix: + include: ${{ fromJSON(inputs.lts_matrix) }} + name: ${{ matrix.name }} + runs-on: ${{ matrix.runs-on }} + env: ${{ matrix.env }} + steps: + - uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d + with: + arch: amd64 + # TODO: use cached_checkout + - uses: actions/checkout@v3 + with: + persist-credentials: false + path: llvm + - name: Register cleanup after job is finished + uses: ./llvm/devops/actions/cleanup + - uses: ./llvm/devops/actions/llvm_test_suite_win + name: Run LLVM Test Suite + with: + test_ref: ${{ inputs.lts_ref }} + sycl_artifact: sycl_windows_default + lit_artifact: sycl_windows_lit + check_sycl_all: ${{ matrix.check_sycl_all }} + results_name_suffix: ${{ matrix.config }}_default + cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}' diff --git a/devops/actions/llvm_test_suite_win/action.yml b/devops/actions/llvm_test_suite_win/action.yml new file mode 100644 index 0000000000000..6e6f5a84c88d9 --- /dev/null +++ b/devops/actions/llvm_test_suite_win/action.yml @@ -0,0 +1,82 @@ +name: 'Run llvm-test-suite testing' +description: 'Run E2E SYCL tests from llvm-test-suite' +inputs: + test_ref: + description: 'commit-ish identifier for test repo' + required: true + default: 'intel' + sycl_artifact: + description: 'Name of the artifact, that contains compiler toolchain' + required: true + lit_artifact: + description: 'Name of the artifact, that contains LIT tool' + required: true + results_name_suffix: + description: 'Name suffix of the results artifact' + required: true + check_sycl_all: + description: 'List of SYCL backends with set of target devices per each to be tested iteratively' + required: true + cmake_args: + description: 'Extra arguments to cmake command' + required: false + +post-if: false +runs: + using: "composite" + steps: + - name: Checkout LLVM Test Suite +# TODO: use cached_checkout + uses: actions/checkout@v3 + with: + path: llvm_test_suite + repository: 'intel/llvm-test-suite' + ref: ${{ inputs.test_ref }} + - name: Download compiler toolchain + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.sycl_artifact }} + path: install + - name: Download LIT + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.lit_artifact }} + path: lit + - name: Configure + shell: cmd + run: | + echo ::group::CMake configuration + dir + mkdir build + set PATH=%GITHUB_WORKSPACE%\install\bin;%PATH% + cmake -GNinja -B.\build -S.\llvm_test_suite -DTEST_SUITE_SUBDIRS=SYCL -DCHECK_SYCL_ALL="${{ inputs.check_sycl_all }}" -DCMAKE_CXX_COMPILER="clang++" -DTEST_SUITE_LIT="%GITHUB_WORKSPACE%\lit\lit.py" ${{ inputs.cmake_args }} + echo ::endgroup:: + - name: Run testing + shell: cmd + run: | + set PATH=%GITHUB_WORKSPACE%\install\bin;%PATH% + set LIT_OPTS=-v --no-progress-bar --show-unsupported --max-time 3600 --time-tests -o results_${{ inputs.results_name_suffix }}.json + echo ::group::sycl-ls --verbose + sycl-ls --verbose + echo ::endgroup:: + echo ::group::SYCL_PI_TRACE=-1 sycl-ls + set SYCL_PI_TRACE=-1 + sycl-ls + set SYCL_PI_TRACE= + echo ::endgroup:: + cd build + ninja check-sycl-all + - name: Upload test results + uses: actions/upload-artifact@v1 + if: always() + with: + name: lit_results_windows + path: build/results_${{ inputs.results_name_suffix }}.json + - name: Cleanup + shell: cmd + if: always() + run: | + rmdir /q /s install + rmdir /q /s lit + rmdir /q /s build + rmdir /q /s llvm_test_suite diff --git a/devops/scripts/generate_test_matrix.js b/devops/scripts/generate_test_matrix.js index 4d90f8e89a9ab..a8d7f1d6275ed 100644 --- a/devops/scripts/generate_test_matrix.js +++ b/devops/scripts/generate_test_matrix.js @@ -2,7 +2,7 @@ module.exports = ({core, process}) => { const fs = require('fs'); fs.readFile('./test_configs.json', 'utf8', (err, data) => { if (err) { - console.log(`Error reading file from disk: ${err}`); + console.error(`Error reading file from disk: ${err}`); } else { const driverNew = JSON.parse(fs.readFileSync('./dependencies.json', 'utf8')); @@ -28,9 +28,12 @@ module.exports = ({core, process}) => { const ltsConfigs = inputs.lts_config.split(';'); - const enabledLTSConfigs = []; + const enabledLTSLxConfigs = []; + const enabledLTSWnConfigs = []; const enabledLTSAWSConfigs = []; + // Process LTS (LLVM Test Suite) + testConfigs.lts.forEach(v => { if (ltsConfigs.includes(v.config)) { if (needsDrivers) { @@ -47,22 +50,33 @@ module.exports = ({core, process}) => { } else { v["env"] = {}; } - enabledLTSConfigs.push(v); + if (v["runs-on"].includes("Windows")) + enabledLTSWnConfigs.push(v); + else if (v["runs-on"].includes("Linux")) + enabledLTSLxConfigs.push(v); + else + console.error("runs-on OS is not recognized"); if (v["aws-type"]) enabledLTSAWSConfigs.push(v); } }); - let ltsString = JSON.stringify(enabledLTSConfigs); + let ltsLxString = JSON.stringify(enabledLTSLxConfigs); + let ltsWnString = JSON.stringify(enabledLTSWnConfigs); let ltsAWSString = JSON.stringify(enabledLTSAWSConfigs); - console.log(ltsString); + console.log("Linux LTS config:") + console.log(ltsLxString); + console.log("Windows LTS config:") + console.log(ltsWnString); + console.log("Linux AWS LTS config:") console.log(ltsAWSString) + // drivers update is supported on Linux only for (let [key, value] of Object.entries(inputs)) { - ltsString = ltsString.replaceAll("${{ inputs." + key + " }}", value); + ltsLxString = ltsLxString.replaceAll("${{ inputs." + key + " }}", value); ltsAWSString = ltsAWSString.replaceAll("${{ inputs." + key + " }}", value); } if (needsDrivers) { - ltsString = ltsString.replaceAll( + ltsLxString = ltsLxString.replaceAll( "ghcr.io/intel/llvm/ubuntu2004_intel_drivers:latest", "ghcr.io/intel/llvm/ubuntu2004_base:latest"); ltsAWSString = ltsAWSString.replaceAll( @@ -70,9 +84,12 @@ module.exports = ({core, process}) => { "ghcr.io/intel/llvm/ubuntu2004_base:latest"); } - core.setOutput('lts_matrix', ltsString); + core.setOutput('lts_lx_matrix', ltsLxString); + core.setOutput('lts_wn_matrix', ltsWnString); core.setOutput('lts_aws_matrix', ltsAWSString); + // Process CTS (Conformance Test Suite) + const ctsConfigs = inputs.cts_config.split(';'); const enabledCTSConfigs = []; @@ -98,6 +115,7 @@ module.exports = ({core, process}) => { }); let ctsString = JSON.stringify(enabledCTSConfigs); + console.log("CTS config:") console.log(ctsString); for (let [key, value] of Object.entries(inputs)) { diff --git a/devops/test_configs.json b/devops/test_configs.json index 3de0a149bd958..fd6ebe4202c7a 100644 --- a/devops/test_configs.json +++ b/devops/test_configs.json @@ -12,6 +12,16 @@ "check_sycl_all": "level_zero:gpu", "cmake_args": "" }, + { + "config": "win_l0_gen9", + "name": "L0 GEN9 LLVM Test Suite", + "runs-on": [ + "Windows", + "gen12" + ], + "check_sycl_all": "level_zero:gpu", + "cmake_args": "" + }, { "config": "ocl_gen9", "name": "OCL GEN9 LLVM Test Suite",