Skip to content

Commit

Permalink
Reduce PR testing overheads
Browse files Browse the repository at this point in the history
Add CMake options CA_CL_UNITCL_NO_VECZ_TEST_LEVEL and
CA_CL_UNITCL_VECZ_TEST_LEVEL to disable full unitcl testing for
non-vecz/vecz and disable the flags being passed to risc-v by default.

Add this into the PR workflow vs the overnight.
  • Loading branch information
coldav committed Oct 29, 2024
1 parent 6c02bae commit 964ad36
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 167 deletions.
12 changes: 12 additions & 0 deletions .github/actions/do_build_ock/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ inputs:
enable_rvv_scalable_vp_vecz_check:
description: "Enable RVV scalable vecz VP check (default OFF)"
default: OFF
unitcl_vecz_test_level:
description: "UnitCL Vecz test level (0=none, 1=minimum, 2=full)"
required: false
type: string
default: false
unitcl_no_vecz_test_level:
description: "UnitCL No Vecz test level (0=none, 1=minimum, 2=full)"
required: false
type: string
default: false
install_dir:
description: "Install directory for OCK"
default: install
Expand Down Expand Up @@ -157,6 +167,8 @@ runs:
-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 }}
-DCA_CL_UNITCL_VECZ_TEST_LEVEL=${{ inputs.unitcl_vecz_test_level }}
-DCA_CL_UNITCL_NO_VECZ_TEST_LEVEL=${{ inputs.unitcl_no_vecz_test_level }}
-DCMAKE_INSTALL_PREFIX=${{ inputs.install_dir }}
-DCA_USE_LINKER=${{ inputs.use_linker }}
-DCA_RUNTIME_COMPILER_ENABLED=${{ inputs.runtime_compiler_enabled }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
# pull_request:
# branches:
# - main
schedule:
- cron: '19 9 * * 3'

Expand Down
216 changes: 126 additions & 90 deletions .github/workflows/run_pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ on:
required: false
type: boolean
default: false
unitcl_vecz_test_level:
required: false
type: string
default: OFF
unitcl_no_vecz_test_level:
required: false
type: string
default: OFF
enable_full_unitcl_riscv_vecz_check:
required: false
type: string
default: OFF

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -15,7 +27,19 @@ on:
required: false
default: false
type: boolean

unitcl_vecz_test_level:
required: false
type: string
default: OFF
unitcl_no_vecz_test_level:
required: false
type: string
default: OFF
enable_full_unitcl_riscv_vecz_check:
required: false
type: boolean
default: false

permissions: {}

concurrency:
Expand All @@ -24,99 +48,99 @@ concurrency:

jobs:

# build and run host x86_64, execute UnitCL and lit tests and build and run offline
run_host_x86_64:
runs-on: ubuntu-22.04

steps:
- name: Checkout repo
uses: actions/checkout@v4

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup-ubuntu
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: RelAssert
save: ${{ inputs.update_cache }}

# These need to match the configurations of build_pr_cache to use the cache effectively
- name: build host x86_64 online release
uses: ./.github/actions/do_build_ock
with:
build_type: Release

- name: run just online lit
run:
ninja -C build check-ock-all-lit

- name: run host online check
run:
ninja -C build check-ock-UnitCL

# use the previous build for online to get clc
- name: build host x86_64 offline release
uses: ./.github/actions/do_build_ock
with:
build_type: Release
extra_flags: -DCA_RUNTIME_COMPILER_ENABLED=OFF -DCA_EXTERNAL_CLC=${{ github.workspace }}/build/bin/clc
build_dir: build_offline
build_targets: UnitCL
assemble_spirv_ll_lit_test_offline: ON

- name: run host x86_64 offline
run:
ninja -C build_offline check-ock-UnitCL

# build and run riscv m1, execute UnitCL and lit tests
run_riscv_m1:

runs-on: ubuntu-22.04

steps:
- name: Checkout repo
uses: actions/checkout@v4

# installs tools, ninja, installs llvm and sets up sccahe
- name: setup-ubuntu
uses: ./.github/actions/setup_build
with:
llvm_version: 18
llvm_build_type: RelAssert
save: ${{ inputs.update_cache }}

- name: build riscv M1
uses: ./.github/actions/do_build_ock/do_build_m1

- name: run riscv M1 lit
run:
ninja -C build check-ock-all-lit

- name: run riscv M1 UnitCL tests
run:
ninja -C build check-ock-UnitCL
# # build and run host x86_64, execute UnitCL and lit tests and build and run offline
# run_host_x86_64:
# runs-on: ubuntu-22.04

# steps:
# - name: Checkout repo
# uses: actions/checkout@v4

# # installs tools, ninja, installs llvm and sets up sccahe
# - name: setup-ubuntu
# uses: ./.github/actions/setup_build
# with:
# llvm_version: 18
# llvm_build_type: RelAssert
# save: ${{ inputs.update_cache }}

# # These need to match the configurations of build_pr_cache to use the cache effectively
# - name: build host x86_64 online release
# uses: ./.github/actions/do_build_ock
# with:
# build_type: Release

# - name: run just online lit
# run:
# ninja -C build check-ock-all-lit

# - name: run host online check
# run:
# ninja -C build check-ock-UnitCL

# # use the previous build for online to get clc
# - name: build host x86_64 offline release
# uses: ./.github/actions/do_build_ock
# with:
# build_type: Release
# extra_flags: -DCA_RUNTIME_COMPILER_ENABLED=OFF -DCA_EXTERNAL_CLC=${{ github.workspace }}/build/bin/clc
# build_dir: build_offline
# build_targets: UnitCL
# assemble_spirv_ll_lit_test_offline: ON

# - name: run host x86_64 offline
# run:
# ninja -C build_offline check-ock-UnitCL

# # build and run riscv m1, execute UnitCL and lit tests
# run_riscv_m1:

# runs-on: ubuntu-22.04

# steps:
# - name: Checkout repo
# uses: actions/checkout@v4

# # installs tools, ninja, installs llvm and sets up sccahe
# - name: setup-ubuntu
# uses: ./.github/actions/setup_build
# with:
# llvm_version: 18
# llvm_build_type: RelAssert
# save: ${{ inputs.update_cache }}

# - name: build riscv M1
# uses: ./.github/actions/do_build_ock/do_build_m1

# - name: run riscv M1 lit
# run:
# ninja -C build check-ock-all-lit

# - name: run riscv M1 UnitCL tests
# run:
# ninja -C build check-ock-UnitCL

# run clang-format-diff on the repo
run_clang_format:
# run_clang_format:

runs-on: ubuntu-22.04
# runs-on: ubuntu-22.04

steps:
- name: Checkout repo
uses: actions/checkout@v4
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4

- name: setup-ubuntu-clang-format
run:
pip install clang-format==19.1.0
# - name: setup-ubuntu-clang-format
# run:
# pip install clang-format==19.1.0

- name: run clang-format
run: |
# we've installed clang-format-19 in the docker via pip, which just installs it as clang-format,
# so just use clang-format-diff and -b clang-format directly
git fetch origin ${{ github.base_ref }}
git diff --no-color origin/${{ github.base_ref }} | \
clang-format-diff.py -p1 -regex \
"^(?!(.+\\/)*(external|cookie)\\/).*\\.(c|cc|cxx|cpp|h|hh|hxx|hpp)$" -b clang-format
# - name: run clang-format
# run: |
# # we've installed clang-format-19 in the docker via pip, which just installs it as clang-format,
# # so just use clang-format-diff and -b clang-format directly
# git fetch origin ${{ github.base_ref }}
# git diff --no-color origin/${{ github.base_ref }} | \
# clang-format-diff.py -p1 -regex \
# "^(?!(.+\\/)*(external|cookie)\\/).*\\.(c|cc|cxx|cpp|h|hh|hxx|hpp)$" -b clang-format

# Based on: mr-windows-msvc-x86_64-llvm-previous-cl3.0-offline
run_windows_msvc_x86_64_llvm_latest_cl3_0_offline:
Expand Down Expand Up @@ -151,6 +175,9 @@ jobs:
debug_support: ON
c_compiler: 'cl.exe'
cxx_compiler: 'cl.exe'
unitcl_no_vecz_test_level: ${{ inputs.unitcl_vecz_test_level }}
unitcl_vecz_test_level: ${{ inputs.unitcl_no_vecz_test_level }}
extra_flags: -DCA_CL_UNITCL_FILTER_OUT="*Offline*"

- name: build ock x86_64 offline
uses: ./.github/actions/do_build_ock
Expand All @@ -165,6 +192,8 @@ jobs:
build_dir: ${{ github.workspace }}/build_offline
c_compiler: 'cl.exe'
cxx_compiler: 'cl.exe'
unitcl_no_vecz_test_level: ${{ inputs.unitcl_vecz_test_level }}
unitcl_vecz_test_level: ${{ inputs.unitcl_no_vecz_test_level }}

# Based on: mr-ubuntu-gcc-x86_64-riscv-fp16-cl3.0-unitcl_vecz
run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0_unitcl_vecz:
Expand All @@ -187,13 +216,15 @@ jobs:
mux_targets_enable: riscv
mux_compilers_enable: riscv
riscv_enabled: ON
enable_rvv_scalable_vecz_check: ON
enable_rvv_scalable_vp_vecz_check: ON
enable_rvv_scalable_vecz_check: ${{ inputs.enable_full_unitcl_riscv_vecz_check }}
enable_rvv_scalable_vp_vecz_check: ${{ inputs.enable_full_unitcl_riscv_vecz_check }}
use_linker: gold
hal_description: RV64GCV_Zfh
hal_refsi_soc: G1
hal_refsi_thread_mode: WG
debug_support: ON
unitcl_no_vecz_test_level: ${{ inputs.unitcl_vecz_test_level }}
unitcl_vecz_test_level: ${{ inputs.unitcl_no_vecz_test_level }}

# Based on: mr-ubuntu-clang-x86-llvm-previous-cl3-0-offline
run-ubuntu-clang-x86-llvm-latest-cl3-0-offline:
Expand All @@ -220,6 +251,9 @@ jobs:
builtin_kernel: ON
use_linker: gold
debug_support: ON
unitcl_no_vecz_test_level: ${{ inputs.unitcl_vecz_test_level }}
unitcl_vecz_test_level: ${{ inputs.unitcl_no_vecz_test_level }}

- name: build ock x86 offline
uses: ./.github/actions/do_build_ock
with:
Expand All @@ -234,3 +268,5 @@ jobs:
debug_support: ON
install_dir: $GITHUB_WORKSPACE/install_offline
build_dir: $GITHUB_WORKSPACE/build_offline
unitcl_no_vecz_test_level: ${{ inputs.unitcl_vecz_test_level }}
unitcl_vecz_test_level: ${{ inputs.unitcl_no_vecz_test_level }}
7 changes: 7 additions & 0 deletions .github/workflows/run_pr_tests_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_build/**'
- '.github/workflows/run_pr_tests.yml'
- '.github/workflows/run_pr_tests_caller.yml'
- 'CMakeLists.txt'
schedule:
# Run Mon-Fri at 7pm
Expand All @@ -24,6 +25,9 @@ jobs:
uses: ./.github/workflows/run_pr_tests.yml
with:
update_cache: false
unitcl_vecz_test_level: 1
unitcl_no_vecz_test_level: 1
enable_full_unitcl_riscv_vecz_check: OFF

# Could have multiple here
run-with-cron:
Expand All @@ -32,5 +36,8 @@ jobs:
uses: ./.github/workflows/run_pr_tests.yml
with:
update_cache: true
unitcl_vecz_test_level: 2
unitcl_no_vecz_test_level: 2
enable_full_unitcl_riscv_vecz_check: ON

# additional ones here for cron and/or push to main - also can be in different file.
Loading

0 comments on commit 964ad36

Please sign in to comment.