Skip to content

DRAFT: migrate refsi_tutorial MRs #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
5 changes: 4 additions & 1 deletion .github/actions/do_build_ock/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ 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:
cmake_path:
description: 'cmake path'
default: .
build_type:
description: 'build type e.g Release, ReleaseAssert (default ReleaseAssert)'
default: ReleaseAssert
Expand Down Expand Up @@ -168,7 +171,7 @@ runs:
-DCA_BUILD_32_BITS=${{ inputs.build_32_bit }}
-DCMAKE_TOOLCHAIN_FILE=${{ inputs.toolchain_file }}
${{ inputs.extra_flags }}
.
${{ inputs.cmake_path }}
- name: build_ock
shell: ${{ inputs.shell_to_use }}
run:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: run-ubuntu-gcc-x86_64-refsi-tutorial-end
description: Build pr ubuntu-gcc-x86_64-refsi-tutorial-end

inputs:
cache_seed:
type: boolean
default: false

runs:
using: "composite"
steps:
- name: remove any old dirs
shell: bash
run:
rm -rf build

- name: build ock
uses: ./.github/actions/do_build_ock
with:
build_targets: check-ock
#build_dir: set to /refsi_tutorial ???
mux_targets_enable: refsi_tutorial
use_linker: gold
# Note : Refsi is not as complete as riscv (e.g. runtime linking)
# so disable offline kernel tests
offline_kernel_tests: OFF
llvm_install_dir: /refsi_tutorial/build/llvm
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might not make sense to be the same directory to be honest - maybe $GITHUB_WORKSPACE/refsi_tutorial?

install_dir: /refsi_tutorial/build/install
debug_support: ON
cmake_path: /refsi_tutorial
# HAL dir = /refsi_tutorial/hal_refsi_tutorial
extra_flags: -DCA_REFSI_TUTORIAL_ENABLED=ON -DCA_EXTERNAL_ONEAPI_CON_KIT_DIR=${{ github.workspace }} -DCA_EXTERNAL_REFSI_TUTORIAL_HAL_DIR=/refsi_tutorial/hal_refsi_tutorial -DCA_BUILTINS_TOOLS_DIR=/refsi_tutorial/build/llvm/llvm_tools/bin
85 changes: 83 additions & 2 deletions .github/workflows/run_pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:

# build and run host x86_64, execute UnitCL and lit tests and build and run offline
run_host_x86_64:
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand Down Expand Up @@ -86,6 +87,7 @@ jobs:

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

runs-on: ubuntu-22.04
container:
Expand Down Expand Up @@ -117,6 +119,7 @@ jobs:

# build and run clang-tidy
run_clang_tidy_changes:
if: false

runs-on: ubuntu-22.04
container:
Expand Down Expand Up @@ -164,6 +167,7 @@ jobs:

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

runs-on: ubuntu-22.04

Expand All @@ -186,6 +190,7 @@ jobs:

# Based on: mr-windows-msvc-x86_64-llvm-previous-cl3.0-offline
run_windows_msvc_x86_64_llvm_latest_cl3_0_offline:
if: false

runs-on: windows-2019

Expand Down Expand Up @@ -214,6 +219,7 @@ jobs:

# Based on: mr-ubuntu-gcc-x86_64-riscv-fp16-cl3.0-unitcl_vecz
run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0_unitcl_vecz:
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand All @@ -234,7 +240,8 @@ jobs:

# Based on: mr-ubuntu-clang-x86-llvm-previous-cl3-0-offline
run-ubuntu-clang-x86-llvm-latest-cl3-0-offline:
if: ${{ !inputs.is_pull_request }} # do not run as PR job due to cross where we always install
#if: ${{ !inputs.is_pull_request }} # do not run as PR job due to cross where we always install
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand All @@ -256,6 +263,7 @@ jobs:

# Based on: mr-ubuntu-gcc-x86_64-riscv-fp16-cl3-0
run-ubuntu-gcc-x86_64-riscv-fp16-cl3-0:
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand All @@ -276,6 +284,7 @@ jobs:

# Based on: mr-ubuntu-gcc-x86-llvm-latest-x86_64-images-cl3-0-release
run-ubuntu-gcc-x86-llvm-latest-x86_64-images-cl3-0-release:
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand All @@ -296,6 +305,7 @@ jobs:

# Based on: mr-ubuntu-gcc-aarch64-llvm-previous-cl3-0-fp16
run-ubuntu-gcc-aarch64-llvm-latest-cl3-0-fp16:
if: false
runs-on: ubuntu-22.04-arm
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-aarch64:latest
Expand All @@ -317,6 +327,7 @@ jobs:
# Based on a combination of: mr-ubuntu-gcc-x86_64-clik
# and: mr-ubuntu-gcc-x86_64-clik-refsi
run-ubuntu-gcc-x86_64-clik-refsi:
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand All @@ -340,7 +351,8 @@ jobs:

# Based on: mr-ubuntu-gcc-x86_64-refsi-g1-wi-cl3-0
run-ubuntu-gcc-x86_64-refsi-g1-wi-cl3-0:
if: ${{ !inputs.is_pull_request }} # do not run as PR job for now to avoid flooding the concurrency
#if: ${{ !inputs.is_pull_request }} # do not run as PR job for now to avoid flooding the concurrency
if: false
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
Expand Down Expand Up @@ -373,3 +385,72 @@ jobs:
# path: |
# oneapi-construction-kit/build/*.fail
# oneapi-construction-kit/build/*.log

# Based on: mr-ubuntu-gcc-x86_64-refsi-tutorial-end
run-ubuntu-gcc-x86_64-refsi-tutorial-end:
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
volumes:
- ${{github.workspace}}:${{github.workspace}}
timeout-minutes: 60
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: setup-ubuntu
uses: ./.github/actions/setup_build
with:
llvm_version: ${{ inputs.llvm_current }}
llvm_build_type: RelAssert
llvm_source: ${{ inputs.llvm_source}}
- name: additional setup
run: |
git config --global --add safe.directory $PWD
pip install cookiecutter
- name: Run
run: |
echo PWD: && pwd && ls -l
scripts/setup_new_target_tutorial.sh -s end -e /refsi_tutorial -f "refsi_wrapper_pass;clmul;replace_mem" $PWD
cd /refsi_tutorial
echo PWD: && pwd && ls -l
- name: build ock
uses: ./.github/actions/do_build_pr/run_ubuntu_gcc_x86_64_refsi_tutorial_end
- name: Still to do
run: |
# Note : Refsi is not as complete as riscv (e.g. runtime linking)
# so disable offline kernel tests
echo python -u $ONEAPI_CON_KIT_DIR/scripts/build.py -Bbuild -GNinja --verbose --clean \
--build_type ReleaseAssert --artefact_name $LLVM_ARTEFACT_NAME \
--target $TARGET \
--source_dir $PWD \
-DCA_ENABLE_HOST_IMAGE_SUPPORT=OFF \
-DCA_ENABLE_API=cl \
-DCA_CL_ENABLE_ICD_LOADER=ON \
-DCA_MUX_TARGETS_TO_ENABLE="refsi_tutorial" \
-DCA_REFSI_TUTORIAL_ENABLED=ON \
-DCA_USE_LINKER=gold \
-DCA_CL_ENABLE_OFFLINE_KERNEL_TESTS=OFF \
-DCA_EXTERNAL_ONEAPI_CON_KIT_DIR=$ONEAPI_CON_KIT_DIR \
-DCA_EXTERNAL_REFSI_TUTORIAL_HAL_DIR=$PWD/hal_refsi_tutorial
echo ninja -Cbuild check-ock-refsi_tutorial-lit
# Run just a quick UnitCL test for now, hal_tutorial causes some failures at present
# see CA-4668
echo OCL_ICD_VENDORS=/dev/null OCL_ICD_FILENAMES=$PWD/build/oneAPIConstructionKit/lib/libCL.so \
$PWD/build/oneAPIConstructionKit/bin/UnitCL \
--gtest_filter=Execution/Execution.Task_01_02_Add/OpenCLC


# Based on: mr-ubuntu-gcc-x86_64-refsi-tutorial-start
run-ubuntu-gcc-x86_64-refsi-tutorial-start:
runs-on: ubuntu-22.04
container:
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest
volumes:
- ${{github.workspace}}:${{github.workspace}}
timeout-minutes: 60
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Run
run: |
echo hello end
Loading