Add ock artefact building #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple workflow for running non-documentation PR testing | ||
name: Run ock tests for PR testing | ||
on: | ||
workflow_call: | ||
inputs: | ||
ock: | ||
required: false | ||
type: boolean | ||
default: true | ||
test_tornado: | ||
required: false | ||
type: boolean | ||
default: true | ||
target_list: | ||
required: false | ||
type: string | ||
llvm_version: | ||
required: false | ||
type: string | ||
default: 18 | ||
- target: host_aarch64_linux | ||
- target: host_x86_64_linux | ||
- target: host_arm_linux | ||
- target: host_refsi_linux | ||
- target: host_i686_linux | ||
- target: host_x86_64_windows | ||
jobs: | ||
create_workflow_vars: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
exclude_except_linux_x86_64_aarch64: ${{ steps.vars.outputs.exclude_except_linux_x86_64_aarch64 }} | ||
steps: | ||
- id: vars | ||
run: | | ||
echo exclude_except_linux_x86_64_aarch64="[ {\"target\": \"host_arm_linux\"}, {\"target\": \"host_refsi_linux\"}, {\"target\": \"host_i686_linux\"}, {\"target\": \"host_x86_64_windows\"}]" >> $GITHUB_OUTPUT | ||
cat $GITHUB_OUTPUT | ||
run: | | ||
echo | ||
# create_ock_artefacts: | ||
# needs: [create_workflow_vars] | ||
# strategy: | ||
# matrix: | ||
# target: ${{ fromJson(inputs.target_list) }} | ||
# exclude: ${{ fromJson(needs.create_workflow_vars.outputs.exclude_except_linux_x86_64_aarch64) }} | ||
# runs-on: ${{ (contains(matrix.target, 'host_riscv') && 'ubuntu-24.04') || (contains(matrix.target, 'windows') && 'windows-2019' || 'ubuntu-22.04' ) }} | ||
# if : inputs.ock | ||
# steps: | ||
# - name: Checkout repo | ||
# uses: actions/checkout@v4 | ||
# - name: build ock artefact | ||
# uses: ./.github/actions/do_build_ock_artefact | ||
# with: | ||
# target: ${{ matrix.target }} | ||
# llvm_version: ${{ inputs.llvm_version }} | ||
build_icd: | ||
needs: [create_workflow_vars] | ||
strategy: | ||
matrix: | ||
target: ${{ fromJson(inputs.target_list) }} | ||
exclude: ${{ fromJson(needs.create_workflow_vars.outputs.exclude_except_linux_x86_64_aarch64) }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: clone ock platform | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
platform | ||
.github | ||
# The following can also be done with the matrix with exclude: to limit the targets to what we want | ||
- name : build and upload icd ${{matrix.target}} | ||
uses: ./.github/actions/do_build_icd | ||
with: | ||
target: ${{matrix.target}} | ||
# - name : build and upload icd aarch64 | ||
# if: (contains(inputs.target_list, 'host_aarch64_linux')) | ||
# uses: ./.github/actions/do_build_icd | ||
# with: | ||
# target: host_aarch64_linux | ||
# Todo: convert to matrix and/or more jobs when support more than host_x86_64_linux | ||
# build_run_tornado: | ||
# if: contains(inputs.target_list, 'host_x86_64_linux') | ||
# needs: [ build_icd, create_ock_artefacts ] | ||
# runs-on: ubuntu-22.04 | ||
# steps: | ||
# - name: clone ock platform | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# sparse-checkout: | | ||
# platform | ||
# .github | ||
# - name : build and upload tornado | ||
# if: (contains(inputs.target_list, 'host_x86_64_linux')) | ||
# uses: ./.github/actions/do_build_tornado | ||
# with: | ||
# target: host_x86_64_linux | ||
# # TODO: Consider separating out tornado build and run in the future | ||
# # but for now it saves us reinstalling everything. | ||
# - name : run tornado example | ||
# uses: ./.github/actions/run_tornado | ||
# with: | ||
# target: host_x86_64_linux | ||
# - name: Install Ninja | ||
# uses: llvm/actions/install-ninja@main | ||
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }} | ||
# build_type: [RelAssert] | ||
# exclude: | ||
# - os: windows-2019 | ||
# - target: riscv64 | ||
# runs-on: ${{ matrix.os }} | ||
# steps: | ||
# # - name: Install Ninja | ||
# # uses: llvm/actions/install-ninja@main | ||
# - name: clone ock platform | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# sparse-checkout: | | ||
# platform | ||
# .github | ||
# - name: download icd artifact | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: icd_${{matrix.os}}_${{matrix.target}} | ||
# path: install_icd | ||
# # Get maven | ||
# - name: fetch maven | ||
# run: | | ||
# wget https://archive.apache.org/dist/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.tar.gz | ||
# tar xf apache-maven-3.9.3-bin.tar.gz | ||
# # for x86, we'll need to do something else for aarch64 | ||
# - name: select jdk21 | ||
# run: | | ||
# sudo update-java-alternatives -s temurin-21-jdk-amd64 | ||
# pip install tqdm | ||
# - name: build tornadovm | ||
# run: | | ||
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1 TornadoVM_build | ||
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'` | ||
# export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk | ||
# export PATH=$PWD/apache-maven-3.9.3/bin:$PATH | ||
# mvn -v | ||
# java --version | ||
# cd TornadoVM_build | ||
# # The tornado build system links in OpenCL assuming it's in a known place. This gets around | ||
# # this by pass CXX as an environment variable as it's difficult to change the build system | ||
# # even if we don't use this script. | ||
# CXX="g++ -L$GITHUB_WORKSPACE/install_icd/lib" make -j8 jdk21 BACKEND=opencl | ||
# # # Not sure if gitlab ci does not follow symbolic links so copy for the artefact | ||
# # cp -r -L $TORNADO_SDK $GITHUB_WORKSPACE/TornadoVM_SDK | ||
# - name: Download ock artefact | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: ock_${{matrix.os}}_${{matrix.target}} | ||
# path: install_ock | ||
# - name: Run tornado example | ||
# run: | | ||
# export ARTEFACT_CHECKOUT_PATH=$GITHUB_WORKSPACE/install_ock | ||
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH | ||
# ls $ARTEFACT_CHECKOUT_PATH | ||
# export ICD_LOADER_INSTALL_PATH=$GITHUB_WORKSPACE/install_icd | ||
# echo ICD_LOADER_INSTALL_PATH is $ICD_LOADER_INSTALL_PATH | ||
# ls $ICD_LOADER_INSTALL_PATH | ||
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH | ||
# echo $LD_LIBRARY_PATH | ||
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so | ||
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'` | ||
# export TORNADO_SDK=$GITHUB_WORKSPACE/TornadoVM_build/bin/sdk | ||
# export PATH=$TORNADO_SDK/bin:$PATH | ||
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1 | ||
# cd TornadoVM | ||
# CA_HOST_DUMP_ASM=1 tornado --printKernel --threadInfo -m tornado.examples/uk.ac.manchester.tornado.examples.compute.MatrixMultiplication2D 256 | ||
# todo : download ock artefact | ||
# Run tornado example | ||
# at some point we will make an artefact if we want to do more, but it is enough to show it working using the created files. | ||
# - name: run tornado example | ||
# run: | | ||
# echo ARTEFACT_CHECKOUT_PATH is $ARTEFACT_CHECKOUT_PATH | ||
# ls $ARTEFACT_CHECKOUT_PATH | ||
# export LD_LIBRARY_PATH=$ICD_LOADER_INSTALL_PATH/lib:$LD_LIBRARY_PATH | ||
# echo $LD_LIBRARY_PATH | ||
# export OCL_ICD_FILENAMES=$ARTEFACT_CHECKOUT_PATH/lib/libCL.so | ||
# export JAVA_HOME=`readlink -f $(command -v java) | sed 's/\/bin\/java//'` | ||
# export TORNADO_SDK=$CI_PROJECT_DIR/TornadoVM_SDK | ||
# export PATH=$TORNADO_SDK/bin:$PATH | ||
# git clone https://github.com/beehive-lab/TornadoVM.git -b develop --depth 1 | ||
# cd TornadoVM | ||
# toolchain: | ||
# description: 'path to toolchain' | ||
# default: $GITHUB_WORKSPACE/ock/platform/x86_64-linux.cmake | ||
# build_type: | ||
# description: 'path to toolchain' | ||
# default: ock/platform/x86_64-linux.cmake | ||
# name: | ||
# description: 'artifact name' | ||
# default: ubuntu-22.04-x86_64 | ||
# use_ock_artefacts: | ||
# needs: [ calc_matrix, create_ock_artefacts ] | ||
# strategy: | ||
# matrix: | ||
# target: ${{ fromJson(needs.calc_matrix.outputs.target_list) }} | ||
# os: ${{ fromJson(needs.calc_matrix.outputs.os_list) }} | ||
# build_type: [RelAssert] | ||
# exclude: | ||
# - os: windows-2019 | ||
# - target: riscv64 | ||
# runs-on: ${{ matrix.os }} | ||
# steps: | ||
# - name: Download ock artefact | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: ock_${{matrix.os}}_${{matrix.target}} | ||
# path: ock_${{matrix.os}}_${{matrix.target}} | ||
# - name: print ock artefact | ||
# run: | | ||
# ls -R . | ||
# echo "${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.arch }}" > foo.txt | ||
# --define CA_CL_ENABLE_ICD_LOADER=ON | ||
# --define OCL_EXTENSION_cl_khr_command_buffer=ON | ||
# --define OCL_EXTENSION_cl_khr_command_buffer_mutable_dispatch=ON | ||
# --define OCL_EXTENSION_cl_khr_extended_async_copies=ON | ||
# --target check-ock | ||
# -B build |