From 618f3ee5fd0dd63b7cf897cb8f798a972ea748cc Mon Sep 17 00:00:00 2001 From: Ross Brunton Date: Fri, 18 Oct 2024 14:14:24 +0100 Subject: [PATCH] Testing Cuda runners --- .github/scripts/get_system_info.sh | 5 + .github/workflows/build-hw-reusable.yml | 4 +- .github/workflows/cmake.yml | 209 ++++-------------------- cmake/helpers.cmake | 4 +- 4 files changed, 43 insertions(+), 179 deletions(-) diff --git a/.github/scripts/get_system_info.sh b/.github/scripts/get_system_info.sh index 8301c99099..eca0f4ff02 100755 --- a/.github/scripts/get_system_info.sh +++ b/.github/scripts/get_system_info.sh @@ -27,6 +27,11 @@ function system_info { echo "**********system_info**********" cat /etc/os-release | grep -oP "PRETTY_NAME=\K.*" cat /proc/version + clang --version + `which clang` --version + md5sum `which clang` + echo "**********Binaries**********" + find build $(dirname "$(readlink -f "$0")")/../../build -type f | xargs md5sum echo "**********SYCL-LS**********" source /opt/intel/oneapi/setvars.sh sycl-ls diff --git a/.github/workflows/build-hw-reusable.yml b/.github/workflows/build-hw-reusable.yml index f29b4120c8..87e9e1fc67 100644 --- a/.github/workflows/build-hw-reusable.yml +++ b/.github/workflows/build-hw-reusable.yml @@ -52,7 +52,7 @@ jobs: static_adapter: "${{inputs.static_loader}}" }] build_type: [Debug, Release] - compiler: [{c: gcc, cxx: g++}, {c: clang, cxx: clang++}] + compiler: [{c: clang, cxx: clang++}] # TODO: The latest L0 loader segfaults when built with clang. exclude: - adapter: {name: L0, platform: ""} @@ -107,7 +107,7 @@ jobs: - name: Build # This is so that device binaries can find the sycl runtime library - run: cmake --build ${{github.workspace}}/build -j $(nproc) + run: cmake --build ${{github.workspace}}/build -j 1 - name: Install # This is to check that install command does not fail diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 0ed1799fbe..b09d34c650 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -135,198 +135,57 @@ jobs: with: test_label: "fuzz-short" - level-zero: - name: Level Zero + ncpu-at-cuda-1: + name: N. Cpu @ Cuda 1 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: L0 - runner_name: L0 - - level-zero-v2: - name: Level Zero V2 + adapter_name: NATIVE_CPU + runner_name: CUDA + ncpu-at-cuda-2: + name: N. Cpu @ Cuda 2 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: L0_V2 - runner_name: L0 - - level-zero-static: - name: Level Zero static + adapter_name: NATIVE_CPU + runner_name: CUDA + ncpu-at-cuda-3: + name: N. Cpu @ Cuda 3 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: L0 - runner_name: L0 - static_loader: ON - static_adapter: ON - - opencl: - name: OpenCL + adapter_name: NATIVE_CPU + runner_name: CUDA + ncpu-at-cuda-4: + name: N. Cpu @ Cuda 4 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: OPENCL - runner_name: OPENCL - platform: "Intel(R) OpenCL" - - cuda: - name: CUDA + adapter_name: NATIVE_CPU + runner_name: CUDA + ncpu-at-cuda-5: + name: N. Cpu @ Cuda 5 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: CUDA + adapter_name: NATIVE_CPU runner_name: CUDA - - hip: - name: HIP + ncpu-at-cuda-6: + name: N. Cpu @ Cuda 6 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: HIP - runner_name: HIP - - native-cpu: - name: Native CPU + adapter_name: NATIVE_CPU + runner_name: CUDA + ncpu-at-cuda-7: + name: N. Cpu @ Cuda 7 uses: ./.github/workflows/build-hw-reusable.yml with: adapter_name: NATIVE_CPU - runner_name: NATIVE_CPU - - # Native CPU jobs are here to force the loader to be used (UR will not use the loader if there is only one target) - combined-opencl-native-cpu: - name: OpenCL + Native CPU (Loader) + runner_name: CUDA + ncpu-at-cuda-8: + name: N. Cpu @ Cuda 8 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: OPENCL - other_adapter_name: NATIVE_CPU - runner_name: OPENCL - platform: "OPENCL:Intel(R) OpenCL" - - combined-level-zero-native-cpu: - name: Level Zero + Native CPU (Loader) + adapter_name: NATIVE_CPU + runner_name: CUDA + ncpu-at-cuda-9: + name: N. Cpu @ Cuda 9 uses: ./.github/workflows/build-hw-reusable.yml with: - adapter_name: L0 - other_adapter_name: NATIVE_CPU - runner_name: L0 - - e2e-level-zero: - name: E2E L0 - permissions: - contents: read - pull-requests: write - needs: [ubuntu-build, level-zero] - uses: ./.github/workflows/e2e_level_zero.yml - - e2e-opencl: - name: E2E OpenCL - permissions: - contents: read - pull-requests: write - needs: [ubuntu-build, opencl] - uses: ./.github/workflows/e2e_opencl.yml - - e2e-cuda: - name: E2E CUDA - permissions: - contents: read - pull-requests: write - needs: [ubuntu-build, cuda] - uses: ./.github/workflows/e2e_cuda.yml - - windows-build: - name: Build - Windows - strategy: - matrix: - os: ['windows-2019', 'windows-2022'] - adapter: [ - {name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'}, - {name: None, var: ''}, {name: L0_V2, var: '-DUR_BUILD_ADAPTER_L0_V2=ON'}, - {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'} - ] - - # TODO: building level zero loader on windows-2019 and clang-cl is currently broken - exclude: - - os: 'windows-2019' - adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'} - - os: 'windows-2019' - adapter: {name: L0_V2, var: '-DUR_BUILD_ADAPTER_L0_V2=ON'} - - os: 'windows-2019' - adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'} - - adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'} - compiler: {c: clang-cl, cxx: clang-cl} - - adapter: {name: L0_V2, var: '-DUR_BUILD_ADAPTER_L0_V2=ON'} - compiler: {c: clang-cl, cxx: clang-cl} - - adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'} - compiler: {c: clang-cl, cxx: clang-cl} - - build_type: [Debug, Release] - compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}] - include: - - compiler: {c: clang-cl, cxx: clang-cl} - toolset: "-T ClangCL" - - os: 'windows-2022' - adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON -DUR_STATIC_ADAPTER_L0=ON'} - build_type: 'Release' - compiler: {c: cl, cxx: cl} - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Install hwloc - run: vcpkg install hwloc:x64-windows - - - name: Configure CMake - env: - VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows" - run: > - cmake - -B${{github.workspace}}/build - ${{matrix.toolset}} - -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}" - -DCMAKE_C_COMPILER=${{matrix.compiler.c}} - -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} - -DCMAKE_POLICY_DEFAULT_CMP0094=NEW - -DUR_ENABLE_TRACING=ON - -DUR_DEVELOPER_MODE=ON - -DUR_BUILD_TESTS=ON - -DUR_FORMAT_CPP_STYLE=OFF - -DUR_CONFORMANCE_TEST_LOADER=OFF - ${{matrix.adapter.var}} - - - name: Build all - run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace" - - macos-build: - name: Build - MacOS - strategy: - matrix: - os: ['macos-13'] - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 - with: - python-version: 3.9 - - - name: Install prerequisites - run: python3 -m pip install -r third_party/requirements.txt - - - name: Install hwloc - run: brew install hwloc - - - name: Configure CMake - run: > - cmake - -B${{github.workspace}}/build - -DUR_ENABLE_TRACING=ON - -DUR_DEVELOPER_MODE=ON - -DCMAKE_BUILD_TYPE=Release - -DUR_BUILD_TESTS=ON - -DUR_FORMAT_CPP_STYLE=ON - -DUMF_ENABLE_POOL_TRACKING=ON - - name: Build - run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) + adapter_name: NATIVE_CPU + runner_name: CUDA diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake index 77ac2b42b3..5458afe412 100644 --- a/cmake/helpers.cmake +++ b/cmake/helpers.cmake @@ -86,7 +86,7 @@ function(add_ur_target_compile_options name) -fvisibility=hidden # cfi-icall requires called functions in shared libraries to also be built with cfi-icall, which we can't # guarantee. -fsanitize=cfi depends on -flto - $<$:-flto -fsanitize=cfi -fno-sanitize=cfi-icall> + $<$:-flto -fsanitize=cfi -fno-sanitize=cfi-icall -fdebug-default-version=4> $<$:-fcf-protection=full> $<$:-fstack-clash-protection> @@ -124,7 +124,7 @@ function(add_ur_target_link_options name) if(NOT MSVC) if (NOT APPLE) target_link_options(${name} PRIVATE - $<$:-flto -fsanitize=cfi -fno-sanitize=cfi-icall> + $<$:-v -flto -fsanitize=cfi -fno-sanitize=cfi-icall -fdebug-default-version=4> "LINKER:-z,relro,-z,now,-z,noexecstack" ) if (UR_DEVELOPER_MODE)