Skip to content

Commit

Permalink
Updates for first windows PR job
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-forbes-cp committed Oct 17, 2024
1 parent 0055c2d commit ceda4f3
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build_portBLAS_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build

- name: Get Intel OneAPI BaseToolkit
shell: bash
Expand Down
122 changes: 65 additions & 57 deletions .github/actions/do_build_ock/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ description: Action to build the oneapi-construction-kit
# Some of these are riscv or host target specific, but it does not harm at present to
# overset cmake values
inputs:
path:
description: 'Change to PATH before building'
default: '.'
build_type:
description: 'build type e.g Release, ReleaseAssert (default ReleaseAssert)'
default: ReleaseAssert
Expand Down Expand Up @@ -98,69 +95,80 @@ inputs:
description: "Disable unitcl vecz checks"
default: OFF
gtest_launcher:
description: "Googletest suite launcher command"
description: "Googletest suite launcher command (default ubuntu)"
default: "/usr/bin/python;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
build_32_bit:
description: "32-bit building"
default: OFF
shell_to_use:
description: "which shell to use (default bash)"
default: bash
c_compiler:
description: "C compiler"
description: "C compiler (default gcc)"
default: "gcc"
cxx_compiler:
description: "C++ compiler"
description: "C++ compiler (default g++)"
default: "g++"

runs:
# We don't want a new docker just a list of steps, so mark as composite
# we don't want a new docker just a list of steps, so mark as composite
using: "composite"
steps:
- name: cmake_ock
shell: bash

- name: windows - set ICD registry and external clc for cmake
id: set_windows
if: startsWith(runner.os, 'Windows')
shell: ${{ inputs.shell_to_use }}
run: |
ARCH="-DCA_BUILD_32_BITS"
if [[ "${{ inputs.arch }}" == "x86" ]]; then
ARCH="${ARCH}=ON"
else
ARCH="${ARCH}=OFF"
fi
cd ${{ inputs.path }}
set -x && cmake -GNinja \
-B${{ inputs.build_dir }} \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCA_MUX_TARGETS_TO_ENABLE=${{ inputs.mux_targets_enable }} \
-DCA_ENABLE_API=${{ inputs.enable_api }} \
-DCA_LLVM_INSTALL_DIR=${{ inputs.llvm_install_dir }} \
-DCA_ENABLE_DEBUG_SUPPORT=${{ inputs.debug_support }} \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DCA_ENABLE_HOST_IMAGE_SUPPORT=${{ inputs.host_image }} \
-DCA_HOST_ENABLE_BUILTIN_KERNEL=${{ inputs.builtin_kernel }} \
-DCA_HOST_ENABLE_BUILTINS_EXTENSION=${{ inputs.host_enable_builtins}} \
-DCA_HOST_ENABLE_FP16=${{ inputs.host_fp16 }} \
-DCA_CL_ENABLE_OFFLINE_KERNEL_TESTS=${{ inputs.offline_kernel_tests }} \
-DCA_ASSEMBLE_SPIRV_LL_LIT_TESTS_OFFLINE=${{ inputs.assemble_spirv_ll_lit_test_offline }} \
-DOCL_EXTENSION_cl_intel_unified_shared_memory=${{ inputs.usm }} \
-DOCL_EXTENSION_cl_khr_command_buffer=${{ inputs.command_buffer }} \
-DOCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=${{ inputs.command_buffer }} \
-DCA_MUX_COMPILERS_TO_ENABLE=${{ inputs.mux_compilers_enable}} \
-DCA_EXTERNAL_MUX_COMPILER_DIRS=${{ inputs.external_compiler_dirs }} \
-DCA_CL_ENABLE_ICD_LOADER=ON \
-DHAL_DESCRIPTION=${{ inputs.hal_description }} \
-DHAL_REFSI_SOC=${{ inputs.hal_refsi_soc }} \
-DHAL_REFSI_THREAD_MODE=${{ inputs.hal_refsi_thread_mode }} \
-DCA_RISCV_ENABLED=${{ inputs.riscv_enabled }} \
-DCA_CL_ENABLE_RVV_SCALABLE_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vecz_check }} \
-DCA_CL_ENABLE_RVV_SCALABLE_VP_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vp_vecz_check }} \
-DCMAKE_INSTALL_PREFIX=${{ inputs.install_dir }} \
-DCA_USE_LINKER=${{ inputs.use_linker }} \
-DCA_RUNTIME_COMPILER_ENABLED=${{ inputs.runtime_compiler_enabled }} \
-DCA_EXTERNAL_CLC=${{ inputs.external_clc }} \
-DCA_CL_DISABLE_UNITCL_VECZ_CHECKS=${{ inputs.disable_unitcl_vecz_checks }} \
-DCA_GTEST_LAUNCHER="${{ inputs.gtest_launcher }}" \
-DCMAKE_C_COMPILER="${{ inputs.c_compiler }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler }}" \
$ARCH \
${{ inputs.extra_flags }} \
$PWD = Convert-Path .; source/cl/tools/icd-register.ps1 "$PWD/${{ inputs.build_dir }}/bin/CL.dll"
echo "inputs.external_clc is ${{ inputs.external_clc }}"
$PATTERN = '[\\]'
$WINDOWSCLC = "${{ inputs.external_clc }}" -replace $PATTERN, '/'
echo "windowsclc is $WINDOWSCLC"
echo "windowsclc='$WINDOWSCLC'" >> $env:GITHUB_OUTPUT
- name: cmake_ock
shell: ${{ inputs.shell_to_use }}
run:
cmake -GNinja
-B${{ inputs.build_dir }}
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCA_MUX_TARGETS_TO_ENABLE=${{ inputs.mux_targets_enable }}
-DCA_ENABLE_API=${{ inputs.enable_api }}
-DCA_LLVM_INSTALL_DIR=${{ inputs.llvm_install_dir }}
-DCA_ENABLE_DEBUG_SUPPORT=${{ inputs.debug_support }}
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }}
-DCA_ENABLE_HOST_IMAGE_SUPPORT=${{ inputs.host_image }}
-DCA_HOST_ENABLE_BUILTIN_KERNEL=${{ inputs.builtin_kernel }}
-DCA_HOST_ENABLE_BUILTINS_EXTENSION=${{ inputs.host_enable_builtins}}
-DCA_HOST_ENABLE_FP16=${{ inputs.host_fp16 }}
-DCA_CL_ENABLE_OFFLINE_KERNEL_TESTS=${{ inputs.offline_kernel_tests }}
-DCA_ASSEMBLE_SPIRV_LL_LIT_TESTS_OFFLINE=${{ inputs.assemble_spirv_ll_lit_test_offline }}
-DOCL_EXTENSION_cl_intel_unified_shared_memory=${{ inputs.usm }}
-DOCL_EXTENSION_cl_khr_command_buffer=${{ inputs.command_buffer }}
-DOCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=${{ inputs.command_buffer }}
-DCA_MUX_COMPILERS_TO_ENABLE=${{ inputs.mux_compilers_enable}}
-DCA_EXTERNAL_MUX_COMPILER_DIRS=${{ inputs.external_compiler_dirs }}
-DCA_CL_ENABLE_ICD_LOADER=ON
-DHAL_DESCRIPTION=${{ inputs.hal_description }}
-DHAL_REFSI_SOC=${{ inputs.hal_refsi_soc }}
-DHAL_REFSI_THREAD_MODE=${{ inputs.hal_refsi_thread_mode }}
-DCA_RISCV_ENABLED=${{ inputs.riscv_enabled }}
-DCA_CL_ENABLE_RVV_SCALABLE_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vecz_check }}
-DCA_CL_ENABLE_RVV_SCALABLE_VP_VECZ_CHECK=${{ inputs.enable_rvv_scalable_vp_vecz_check }}
-DCMAKE_INSTALL_PREFIX=${{ inputs.install_dir }}
-DCA_USE_LINKER=${{ inputs.use_linker }}
-DCA_RUNTIME_COMPILER_ENABLED=${{ inputs.runtime_compiler_enabled }}
-DCA_EXTERNAL_CLC=${{ startsWith(runner.os, 'Windows') && steps.set_windows.outputs.windowsclc || inputs.external_clc }}
-DCA_CL_DISABLE_UNITCL_VECZ_CHECKS=${{ inputs.disable_unitcl_vecz_checks }}
-DCA_GTEST_LAUNCHER="${{ inputs.gtest_launcher }}"
-DCA_BUILD_32_BITS=${{ inputs.build_32_bit }}
-DCMAKE_C_COMPILER=${{ inputs.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ inputs.cxx_compiler }}
${{ inputs.extra_flags }}
.
- name: build_ock
shell: bash
run: |
cd ${{ inputs.path }}
set -x && ninja -C ${{ inputs.build_dir }} ${{ inputs.build_targets }}
shell: ${{ inputs.shell_to_use }}
run:
ninja -C ${{ inputs.build_dir }} ${{ inputs.build_targets }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: setup-ubuntu-build
description: Setup ubuntu ready for building. Includes installs, ninja, build cache setup and loading llvm cache
name: setup-build
description: Setup ready for building. Includes installs, ninja, build cache setup and loading llvm cache

inputs:
os:
description: 'OS - ubuntu or windows'
default: ubuntu
llvm_build_type:
description: 'llvm Build type (Release, RelAssert) - note we need to use RelAssert for the cache pattern matching'
default: RelAssert
Expand All @@ -11,6 +14,9 @@ inputs:
ubuntu_version:
description: 'Version of ubuntu used for cache retrieval and prerequisites'
default: 22.04
windows_version:
description: 'Version of windows used for cache retrieval and prerequisites'
default: 2019
save:
description: 'Save the build cache at the end - not for PR testing'
default: false
Expand All @@ -22,7 +28,8 @@ runs:
# We don't want a new docker just a list of steps, so mark as composite
using: "composite"
steps:
- name: Install prerequisites
- name: Install ubuntu prerequisites
if: ${{ inputs.os == 'ubuntu' }}
shell: bash
run: |
pip install lit clang-format==19.1.0 virtualenv
Expand All @@ -35,14 +42,26 @@ runs:
sudo apt-get install --yes doxygen
sudo apt-get install --yes vulkan-sdk
if [ "${{ inputs.arch }}" = "x86" ]; then sudo apt-get install --yes gcc-multilib g++-multilib libc6-dev:i386 lib32tinfo-dev ; fi
- name: Install windows prerequisites
if: ${{ inputs.os == 'windows' }}
shell: pwsh
run: |
Invoke-WebRequest https://sdk.lunarg.com/sdk/download/1.3.283.0/windows/VulkanSDK-1.3.283.0-Installer.exe -OutFile Installer.exe
.\Installer.exe --accept-licenses --default-answer --confirm-command install
rm Installer.exe
# add VulcanSDK to path
echo "PATH=C:\VulkanSDK\1.3.283.0\Bin;$env:PATH" >> $env:GITHUB_ENV
pip install lit
- name: Install Ninja
uses: llvm/actions/install-ninja@main

- name: load llvm
uses: actions/cache/restore@v4
with:
path: llvm_install/**
key: llvm-ubuntu-${{ inputs.ubuntu_version }}-${{ inputs.arch }}-v${{ inputs.llvm_version}}-${{ inputs.llvm_build_type }}
key: llvm-${{ inputs.os }}-${{ inputs.os == 'ubuntu' && inputs.ubuntu_version || inputs.windows_version }}-${{ inputs.arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
fail-on-cache-miss: true

# note the PR testing usage should set 'save' to false, to avoid PR testing creating new caches on a branch
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ updates:
- "/.github/actions/build_portBLAS_action"
- "/.github/actions/build_portDNN_action"
- "/.github/actions/build_vgg_resnet_action"
- "/.github/actions/setup_ubuntu_build"
- "/.github/actions/setup_build"
schedule:
interval: "monthly"
groups:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_pr_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
paths:
- '.github/workflows/build_pr_cache.yml'
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_ubuntu_build/**'
- '.github/actions/setup_build/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -32,7 +32,7 @@ jobs:

# installs tools, ninja and installs llvm (default 18, RelAssert) and sets up cache
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
save: true
llvm_version: 18
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

# installs tools, ninja and installs llvm (default 18, RelAssert) and sets up cache
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
save: true
llvm_version: 18
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

# installs tools, ninja and installs llvm (default 18, RelAssert) and sets up cache
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
save: true
llvm_version: 18
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_publish_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

# installs tools, ninja, installs llvm and sets up sccache
- name: Setup ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: Release
Expand Down
54 changes: 51 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- cmake/**
- hal/**
- .github/actions/do_build_ock/**
- .github/actions/setup_ubuntu_build/**
- .github/actions/setup_build/**
- .github/workflows/pull_request.yml
- CMakeLists.txt
concurrency:
Expand All @@ -27,10 +27,11 @@ jobs:
- name: Checkout repo
uses: actions/[email protected]
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
llvm_version: '18'
llvm_build_type: RelAssert
os: ubuntu
- run: echo WORKSPACE is $GITHUB_WORKSPACE && echo PWD is `pwd` && ls -al
- name: build ock
uses: ./.github/actions/do_build_ock
Expand All @@ -46,4 +47,51 @@ jobs:
hal_refsi_soc: G1
hal_refsi_thread_mode: WG
debug_support: ON
gtest_launcher: "/usr/bin/python;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"

############### JOB mr-windows-msvc-x86_64-llvm-latest-cl3-0-offline

mr-windows-msvc-x86_64-llvm-latest-cl3-0-offline:
runs-on: windows-2019
steps:

- name: Setup Windows llvm base
uses: llvm/actions/setup-windows@main
with:
arch: amd64

- name: Checkout repo
uses: actions/[email protected]

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup-windows
uses: ./.github/actions/setup_build
with:
llvm_version: 19
llvm_build_type: RelAssert
os: windows

- name: build ock x86_64 relassert
uses: ./.github/actions/do_build_ock
with:
build_targets: check-ock
enable_api: ""
builtin_kernel: ON
shell_to_use: pwsh
gtest_launcher: "python3;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
debug_support: ON
c_compiler: 'cl.exe'
cxx_compiler: 'cl.exe'

- name: build ock x86_64 offline
uses: ./.github/actions/do_build_ock
with:
build_targets: check-ock
runtime_compiler_enabled: OFF
external_clc: "${{ github.workspace }}/build/bin/clc.exe"
shell_to_use: pwsh
gtest_launcher: "python3;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
debug_support: ON
install_dir: ${{ github.workspace }}/install_offline
build_dir: ${{ github.workspace }}/build_offline
c_compiler: 'cl.exe'
cxx_compiler: 'cl.exe'
2 changes: 1 addition & 1 deletion .github/workflows/run_ock_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: RelAssert
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- 'cmake/**'
- 'hal/**'
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_ubuntu_build/**'
- '.github/actions/setup_build/**'
- '.github/workflows/run_pr_tests.yml'
- 'CMakeLists.txt'

Expand All @@ -35,7 +35,7 @@ jobs:

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: RelAssert
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup-ubuntu
uses: ./.github/actions/setup_ubuntu_build
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: RelAssert
Expand Down

0 comments on commit ceda4f3

Please sign in to comment.