Skip to content

Commit

Permalink
TBD
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Jan 14, 2025
1 parent ad0d899 commit 6e0f22d
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 23 deletions.
39 changes: 28 additions & 11 deletions .github/actions/do_build_dpcpp/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ description: build dpc++
inputs:
target:
description: 'target architecture'
create_dpcpp_artefact_method:
description: 'build | download_release' # TODO: add support for 'previous workflow' download
download_dpcpp_artefact:
description: 'download ock artefact rather than building, of form <target>=id;<target2=id2>.'
#' Special valuebuild | download_release' # TODO: add support for 'previous workflow' download
type: string
default: "build"

Expand All @@ -27,14 +28,14 @@ runs:
sudo apt-get install spirv-tools

- name: clone dpc++
if: inputs.create_dpcpp_artefact_method == 'build'
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
uses: actions/checkout@v4
with:
repository: intel/llvm
path: llvm

- name: dpcpp configure
if: inputs.create_dpcpp_artefact_method == 'build'
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
shell: bash
run:
cd llvm; python buildbot/configure.py
Expand All @@ -47,19 +48,19 @@ runs:
--cmake-opt=-DLLVM_ENABLE_ZSTD=OFF

- name: build sycl-headers
if: inputs.create_dpcpp_artefact_method == 'build'
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
shell: bash
run:
cmake --build llvm/build -- sycl-headers

- name: build dpc plus plus
if: inputs.create_dpcpp_artefact_method == 'build'
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
shell: bash
run:
python llvm/buildbot/compile.py -o llvm/build -v -j 8

- name: build extra utilties
if: inputs.create_dpcpp_artefact_method == 'build'
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
# Build various utilities, since those aren't proper dependencies.
# FileCheck and not are needed for tests. The rest are needed for
# cross builds. They are enabled on all targets for consistency.
Expand All @@ -70,7 +71,7 @@ runs:
opt prepare_builtins -j8

- name: copy utilities
if: inputs.create_dpcpp_artefact_method == 'build'
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
shell: bash
run:
cd llvm/build/bin;
Expand All @@ -80,7 +81,7 @@ runs:
# TODO: For now just linux x86_64
# Review for location of components (paths) and any archive package/unpackage reqs.
#- name: install config files to pick up libraries for cross compilation.
# if: inputs.create_dpcpp_artefact_method == 'build'
# if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
# shell: bash
# run: |
# echo Installing configuration files
Expand All @@ -94,8 +95,9 @@ runs:
# " >../install/bin/$arch-unknown-linux-gnu.cfg;
# done

- name: download dpc plus plus
if: inputs.create_dpcpp_artefact_method == 'download_release'
- name: download dpc plus plus from official releases
# TODO: This is a bit imperfect as it should parse it properly
if: contains(inputs.download_dpcpp_artefact, inputs.target) && contains(inputs.download_dpcpp_artefact, 'download_release')
shell: bash
run: |
mkdir -p llvm/build/install
Expand All @@ -108,8 +110,23 @@ runs:
tar xf sycl_linux.tar.gz
rm sycl_linux.tar.gz
- name: download previous dpcpp if needed ${{ inputs.target }} ${{ matrix.download_dpcpp_artefact}}
shell: bash
if: contains(inputs.download_dpcpp_artefact, inputs.target) && contains(inputs.download_dpcpp_artefact, 'download_release') != true
run: |
download_id=`echo "${{inputs.download_dpcpp_artefact}}"`
echo "echo $download_id | sed 's/.*${{inputs.target}}=//' | sed 's/;.*//'"
download_id=`echo $download_id | sed 's/.*${{inputs.target}}=//' | sed 's/;.*//'`
echo download id is "'$download_id'"
# TODO : make this work on windows
mkdir -p llvm/build/install
gh run download $download_id -n dpcpp_${{ inputs.target }} -D llvm/build/install
ls llvm/build/install
- name: package artefacts # package/unpackage avoids known 'permissions loss' issue
shell: bash
if: contains(inputs.download_dpcpp_artefact, inputs.target) != true
run: |
cd llvm/build/install
tar cf dpcpp.tar *
Expand Down
22 changes: 19 additions & 3 deletions .github/actions/do_build_ock_artefact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
vulkan_sdk_install:
description: 'vulkan install flag'
default: true
download_ock_artefact:
description: 'download ock artefact rather than building, of form <target>=id;<target2=id2>.'
default: ''

# TODO: This has not been tested yet on windows so would likely need some updating.
runs:
Expand All @@ -32,6 +35,7 @@ runs:
# installs tools, ninja, installs llvm and sets up ccache
- name: setup
uses: ./.github/actions/setup_build
if: contains(inputs.download_ock_artefact, inputs.target) != true
with:
llvm_version: ${{ inputs.llvm_version }}
llvm_build_type: RelAssert
Expand All @@ -40,16 +44,16 @@ runs:
os: ${{ contains(inputs.target, 'windows') && 'windows' || 'ubuntu' }}

- name: build ock x86
if: steps.calc_vars.outputs.arch == 'x86_64'
if: steps.calc_vars.outputs.arch == 'x86_64' && contains(inputs.download_ock_artefact, inputs.target) != true
uses: ./.github/actions/do_build_ock
with:
build_targets: install
offline_kernel_tests: OFF
extra_flags: -DCA_ENABLE_TESTS=OFF -DCA_ENABLE_EXAMPLES=OFF -DCA_ENABLE_DOCUMENTATION=OFF
shell_to_use: ${{ contains(inputs.target, 'windows') && 'pwsh' || 'bash' }}

- name: build ock other ${{ matrix.target }}
if: steps.calc_vars.outputs.arch != 'x86_64'
- name: build ock other ${{ inputs.target }}
if: steps.calc_vars.outputs.arch != 'x86_64' && contains(inputs.download_ock_artefact, inputs.target) != true
uses: ./.github/actions/do_build_ock
with:
build_targets: install
Expand All @@ -59,6 +63,18 @@ runs:
offline_kernel_tests: OFF
host_fp16: ON

- name: download previous ock if needed ${{ inputs.target }} ${{ matrix.download_dpcpp_artefact}}
shell: bash
if: contains(inputs.download_ock_artefact, inputs.target)
run: |
download_id=`echo "${{inputs.download_ock_artefact}}"`
echo "echo $download_id | sed 's/.*${{inputs.target}}=//' | sed 's/;.*//'"
download_id=`echo $download_id | sed 's/.*${{inputs.target}}=//' | sed 's/;.*//'`
echo download id is "'$download_id'"
# TODO : make this work on windows
gh run download $download_id -n ock_${{ inputs.target }} -D install
ls install
# Prune it as there is too much things in there we don't want to use
# Todo: move this logic to cmake settings so that we build only what we
# want to install. As time goes on we may want to install more.
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/do_build_sycl_cts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description: build sycl cts
inputs:
target:
description: 'target architecture'
download_sycl_cts_artefact:
description: 'download ock artefact rather than building, of form <target>=id;<target2=id2>.'
default: ''

runs:
using: "composite"
Expand All @@ -15,41 +18,48 @@ runs:
target: ${{ inputs.target }}

- name: Install Ninja
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
uses: llvm/actions/install-ninja@main

- name: download icd artifact
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
uses: actions/download-artifact@v4
with:
name: icd_${{inputs.target}}
path: install_icd

- name: download headers artifact
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
uses: actions/download-artifact@v4
with:
name: header_${{inputs.target}}
path: install_headers

- name: download dpc++ artifact
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
uses: actions/download-artifact@v4
with:
name: dpcpp_${{inputs.target}}
path: install_dpcpp

- name: unpackage dpc++ artifacts # package/unpackage avoids known 'permissions loss' issue
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
shell: bash
run: |
cd install_dpcpp
tar xf dpcpp.tar
rm dpcpp.tar
- name: checkout sycl cts
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
uses: actions/checkout@v4
with:
repository: KhronosGroup/SYCL-CTS
path: SYCL-CTS.src
submodules: true

- name: build SYCL CTS
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
shell: bash
run: |
echo calling cmake and ninja on SYCL CTS
Expand All @@ -70,12 +80,27 @@ runs:
ninja -C SYCL-CTS -v -j4 -k 0 || :
- name: package artefacts # package/unpackage avoids known 'permissions loss' issue
if: contains(inputs.download_sycl_cts_artefact, inputs.target) != true
shell: bash
run: |
cd SYCL-CTS
# only bin
tar cf sycl-cts.tar bin
- name: download sycl cts artefact # package/unpackage avoids known 'permissions loss' issue
if: contains(inputs.download_sycl_cts_artefact, inputs.target)
shell: bash
run: |
download_id=`echo "${{inputs.download_dpcpp_artefact}}"`
echo "echo $download_id | sed 's/.*${{inputs.target}}=//' | sed 's/;.*//'"
download_id=`echo $download_id | sed 's/.*${{inputs.target}}=//' | sed 's/;.*//'`
echo download id is "'$download_id'"
# TODO : make this work on windows
mkdir -p SYCL-CTS
gh run download $download_id -n dpcpp_${{ inputs.target }} -D SYCL-CTS
ls SYCL-CTS
- name: upload artefact
uses: actions/upload-artifact@v4
with:
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/setup_gh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: setup gh
description: Set up github's cli gh

inputs:
os:
description: 'os to use (contains windows or ubuntu)'
default: 'ubuntu'
token:
description: 'token for gh'

runs:
using: "composite"
steps:
- name: set up secret ubuntu
shell: bash
run:
echo "GH_TOKEN=${{ inputs.token }}" >> $GITHUB_ENV
- name: install gh
if: contains(inputs.os, 'ubuntu')
shell: bash
run:
sudo apt-get install --yes gh
1 change: 1 addition & 0 deletions .github/opencl_cts/expect_fail_all.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API,api/test_api
27 changes: 27 additions & 0 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ on:
required: false
type: boolean
default: false
download_ock_artefact:
required: false
type: string
default: ''
download_dpcpp_artefact:
required: false
type: string
default: ''
download_sycl_cts_artefact:
required: false
type: string
default: ''

jobs:

Expand Down Expand Up @@ -89,12 +101,18 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up gh
uses: ./.github/actions/setup_gh
with:
os: ${{ contains( matrix.target, 'windows') && 'windows' || 'ubuntu' }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: build ock artefact
uses: ./.github/actions/do_build_ock_artefact
with:
target: ${{ matrix.target }}
llvm_version: ${{ inputs.llvm_version }}
vulkan_sdk_install: false
download_ock_artefact: ${{ inputs.download_ock_artefact }}

build_icd:
if: inputs.test_tornado || inputs.test_opencl_cts || inputs.test_sycl_cts
Expand Down Expand Up @@ -174,11 +192,13 @@ jobs:
source
platform
.github
# TODO: Consider separating out opencl_cts build and run in the future
- name : build and upload opencl_cts
uses: ./.github/actions/do_build_opencl_cts
with:
target: ${{ matrix.target }}
download_opencl_artefact: ${{ inputs.download_opencl_artefact }}
- name : run opencl_cts
uses: ./.github/actions/run_opencl_cts
with:
Expand All @@ -202,10 +222,16 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up gh
uses: ./.github/actions/setup_gh
with:
os: ${{ contains( matrix.target, 'windows') && 'windows' || 'ubuntu' }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: build dpc++ artefact
uses: ./.github/actions/do_build_dpcpp
with:
target: ${{ matrix.target }}
download_dpcpp_artefact: ${{ inputs.download_dpcpp_artefact }}

build_sycl_cts:
needs: [workflow_vars, build_icd, build_dpcpp_native_host]
Expand All @@ -230,6 +256,7 @@ jobs:
uses: ./.github/actions/do_build_sycl_cts
with:
target: ${{ matrix.target }}
download_sycl_cts_artefact: ${{ inputs.download_sycl_cts_artefact }}

run_sycl_cts:
needs: [workflow_vars, create_ock_artefacts_ubuntu, build_dpcpp_native_host, build_sycl_cts]
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/planned_testing_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name: Run planned testing
on:
# Note: use pull_request: for localized testing only
#pull_request:
# paths:
# - '.github/workflows/planned_testing.yml'
# - '.github/workflows/planned_testing_caller.yml'
# branches:
# - main
pull_request:
paths:
- '.github/workflows/planned_testing.yml'
- '.github/workflows/planned_testing_caller.yml'
branches:
- main
schedule:
# Run Mon-Fri at 7pm
- cron: '00 19 * * 1-5'
Expand All @@ -23,11 +23,16 @@ jobs:
if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule'
uses: ./.github/workflows/planned_testing.yml
with:
target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
# target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux"]'
ock: true
test_tornado: true
test_tornado: false
test_sycl_cts: true
test_opencl_cts: true
test_opencl_cts: false
# Have a pull request setting which can be used to test the flow as best as possible
# in a reasonable time
download_ock_artefact: host_x86_64_linux=12754443932;host_aarch64_linux=12754443932
download_dpcpp_artefact: host_x86_64_linux=12754443932;host_aarch64_linux=12754443932
download_sycl_cts_artefact: host_x86_64_linux=12769150464;host_aarch64_linux=12769150464
# create_opencl_cts_artefact_method: 12300776706
pull_request: ${{ github.event_name == 'pull_request' }}

0 comments on commit 6e0f22d

Please sign in to comment.