Skip to content
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

Add SYCL-CTS (x86_64/linux) to planned testing #603

Merged
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d19a0d7
Add Colins inherited baseline @ 74f9e852
alan-forbes-cp Dec 4, 2024
5fb51fb
Add initial dpcpp download
alan-forbes-cp Dec 4, 2024
7190d10
Fix build param usage
alan-forbes-cp Dec 4, 2024
f6fec62
inputs
alan-forbes-cp Dec 4, 2024
0a33629
Add missing if:
alan-forbes-cp Dec 4, 2024
93ea0bb
Add artefact listsings
alan-forbes-cp Dec 4, 2024
445fce3
add package/unpackage
alan-forbes-cp Dec 4, 2024
527c2f3
fix tar syntax
alan-forbes-cp Dec 4, 2024
2491d07
fix indentation
alan-forbes-cp Dec 4, 2024
941e976
extract tar
alan-forbes-cp Dec 4, 2024
cb29fcd
checkout submodules
alan-forbes-cp Dec 4, 2024
a970dc8
tweak ninja args
alan-forbes-cp Dec 5, 2024
24164ad
add exclusions
alan-forbes-cp Dec 5, 2024
bc94bed
test exclusions file format
alan-forbes-cp Dec 5, 2024
8518c2c
more exclude format
alan-forbes-cp Dec 5, 2024
252ad3a
more formatting
alan-forbes-cp Dec 5, 2024
858b517
final exclude format (for now)
alan-forbes-cp Dec 5, 2024
85d16ef
reformat after linting
alan-forbes-cp Dec 5, 2024
6ba3962
update sycl cts run vars
alan-forbes-cp Dec 5, 2024
774f296
add .csv file and logging
alan-forbes-cp Dec 5, 2024
25c8078
more logging
alan-forbes-cp Dec 5, 2024
2ab9d5b
Fix set -x logging
alan-forbes-cp Dec 6, 2024
d77e971
Tidy env vars. add SYCL-CTS download
alan-forbes-cp Dec 6, 2024
729721b
package/unpackage sycl-cts
alan-forbes-cp Dec 6, 2024
25dc1b7
add final diff
alan-forbes-cp Dec 6, 2024
83d4a64
Update .csv file vars
alan-forbes-cp Dec 6, 2024
ad1f0c3
Set execute perms
alan-forbes-cp Dec 6, 2024
195ffc7
Fix dpc++ version logic; comment-out list/diff script
alan-forbes-cp Dec 6, 2024
f44831b
add sycl-cts build patch
alan-forbes-cp Dec 6, 2024
d022f8c
Fix patch path
alan-forbes-cp Dec 6, 2024
2c352b6
Fix SYCL patch - wrong content!
alan-forbes-cp Dec 6, 2024
83cf5df
build dpcpp
alan-forbes-cp Dec 6, 2024
37c0a4f
add more logging for dpcpp build/package
alan-forbes-cp Dec 9, 2024
1bd9639
More logging for install
alan-forbes-cp Dec 9, 2024
eab6d8c
restore download - add logging for runner issue
alan-forbes-cp Dec 9, 2024
0e239d3
Add new swap file + 1 exclusion
alan-forbes-cp Dec 10, 2024
470d519
build dpc++; no swap extension; no x-comp lib config files
alan-forbes-cp Dec 10, 2024
3ca134d
Add 8GB swap + -j4 ninja for sycl-cts build
alan-forbes-cp Dec 10, 2024
a7b111c
Tidy for review (part 1)
alan-forbes-cp Dec 11, 2024
ee0c3ed
Tidy for review (part 2)
alan-forbes-cp Dec 11, 2024
2bcf868
Merge branch 'main' into alan/OR-636_sycl_cts_testing
alan-forbes-cp Dec 11, 2024
d86e0f2
Remove all development scaffolding; add download_dpcpp_artefact revie…
alan-forbes-cp Dec 12, 2024
55c96a3
Merge branch 'main' into alan/OR-636_sycl_cts_testing
alan-forbes-cp Dec 12, 2024
e1ba16b
Fix codeql workflow indent
alan-forbes-cp Dec 12, 2024
6384f12
fix target_list in planned caller
alan-forbes-cp Dec 12, 2024
2710cc6
Review updates for download_dpcpp_artefact and plannied_testing PRs.
alan-forbes-cp Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/actions/do_build_dpcpp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: build dpc++
description: build dpc++

inputs:
target:
description: 'target architecture'
download_dpcpp_artefact:
description: 'none | dpcpp_release' # TODO: add support for 'previous workflow' download
type: string
default: "none"

runs:
using: "composite"
steps:
- name: calc vars
id: calc_vars
uses: ./.github/actions/calc_vars
with:
target: ${{ inputs.target }}

- name: Install Ninja
uses: llvm/actions/install-ninja@main

- name: Install spirv tools
shell: bash
run:
sudo apt-get install spirv-tools

- name: clone dpc++
if: inputs.download_dpcpp_artefact == 'none'
uses: actions/checkout@v4
with:
repository: intel/llvm
path: llvm

- name: dpcpp configure
if: inputs.download_dpcpp_artefact == 'none'
shell: bash
run:
cd llvm; python buildbot/configure.py
-o build
--host-target="X86;AArch64;RISCV"
--native_cpu
--llvm-external-projects=lld
--cmake-opt=-DNATIVECPU_USE_OCK=ON
--cmake-opt=-DLLVM_ENABLE_ZLIB=OFF
--cmake-opt=-DLLVM_ENABLE_ZSTD=OFF

- name: build sycl-headers
if: inputs.download_dpcpp_artefact == 'none'
alan-forbes-cp marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
run:
cmake --build llvm/build -- sycl-headers

- name: build dpc plus plus
if: inputs.download_dpcpp_artefact == 'none'
shell: bash
run:
python llvm/buildbot/compile.py -o llvm/build -v -j 8

- name: build extra utilties
if: inputs.download_dpcpp_artefact == 'none'
# 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.
shell: bash
run:
cmake --build llvm/build -- FileCheck clang-tblgen
libclc-remangler llvm-as llvm-min-tblgen llvm-tblgen not
opt prepare_builtins -j8

- name: copy utilities
if: inputs.download_dpcpp_artefact == 'none'
shell: bash
run:
cd llvm/build/bin;
cp FileCheck clang-tblgen libclc-remangler llvm-as llvm-min-tblgen
llvm-tblgen not opt prepare_builtins ../install/bin

# TODO: For now just linux x86_64
alan-forbes-cp marked this conversation as resolved.
Show resolved Hide resolved
# 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.download_dpcpp_artefact == 'none'
# shell: bash
# run: |
# echo Installing configuration files
# cd llvm/build/bin
# # Install configuration files to pick up libraries for cross compilation.
# for arch in x86_64 aarch64 riscv64; do
# echo "
# -L<CFGDIR>/../../../$arch-linux/install/lib
# -fsycl-libdevice-path=<CFGDIR>/../../../$arch-linux/install/lib
# -fsycl-libspirv-path=<CFGDIR>/../../../$arch-linux/install/lib/clc/remangled-l64-signed_char.libspirv-$arch-unknown-linux-gnu.bc
# " >../install/bin/$arch-unknown-linux-gnu.cfg;
# done

- name: download dpc plus plus
if: inputs.download_dpcpp_artefact == 'dpcpp_release'
shell: bash
run: |
mkdir -p llvm/build/install
cd llvm/build/install
# Get latest build - go back 2 weeks max else fail
for COUNTER in {0..13}; do
DATESTAMP=$(date -d "-$COUNTER day" '+%Y-%m-%d')
wget -q https://github.com/intel/llvm/releases/download/nightly-$DATESTAMP/sycl_linux.tar.gz && echo Using DPC++ release build: $DATESTAMP && break
done
tar xf sycl_linux.tar.gz
rm sycl_linux.tar.gz

- name: package artefacts # package/unpackage avoids known 'permissions loss' issue
alan-forbes-cp marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
run: |
cd llvm/build/install
tar cf dpcpp.tar *

- name: upload dpcpp artifact
uses: actions/upload-artifact@v4
with:
name: dpcpp_${{inputs.target}}
path: llvm/build/install/dpcpp.tar
retention-days: 1
101 changes: 101 additions & 0 deletions .github/actions/do_build_sycl_cts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: build sycl cts
description: build sycl cts

inputs:
target:
description: 'target architecture'

runs:
using: "composite"
steps:
- name: calc vars
id: calc_vars
uses: ./.github/actions/calc_vars
with:
target: ${{ inputs.target }}

- name: Install Ninja
uses: llvm/actions/install-ninja@main

- name: download icd artifact
uses: actions/download-artifact@v4
with:
name: icd_${{inputs.target}}
path: install_icd

- name: download headers artifact
uses: actions/download-artifact@v4
with:
name: header_${{inputs.target}}
path: install_headers

- name: download dpc++ artifact
uses: actions/download-artifact@v4
with:
name: dpcpp_${{inputs.target}}
path: install_dpcpp

- name: unpackage dpc++ artifacts # package/unpackage avoids known 'permissions loss' issue
shell: bash
run: |
cd install_dpcpp
tar xf dpcpp.tar
rm dpcpp.tar

- name: checkout sycl cts
uses: actions/checkout@v4
with:
repository: KhronosGroup/SYCL-CTS
path: SYCL-CTS.src
submodules: true

- name: expand runner swap
# Needed to allow building - else current default memory restrictions lead to the runner being killed
shell: bash
run: |
set -x
df -h
sudo swapon --show
sudo swapoff -a
sudo fallocate -l 8G /mnt/swapfilenew
sudo chmod 600 /mnt/swapfilenew
sudo mkswap /mnt/swapfilenew
sudo swapon /mnt/swapfilenew
sudo swapon --show
df -h
set +x

- name: build SYCL CTS
shell: bash
run: |
echo calling cmake and ninja on SYCL CTS
# Todo: as we extend into cross etc, we may want to expand on the cxx flags
# We build SYCL-CTS without installing it, so build directly in the top level.
git -C SYCL-CTS.src log -1
git -C SYCL-CTS.src apply $GITHUB_WORKSPACE/.github/patches/SYCL-CTS-0002-Permit-building-for-unknown-architectures.patch
cmake -S SYCL-CTS.src \
-GNinja \
-B SYCL-CTS \
-DSYCL_IMPLEMENTATION=DPCPP \
-DDPCPP_INSTALL_DIR=$GITHUB_WORKSPACE/install_dpcpp \
-DOpenCL_LIBRARY=$GITHUB_WORKSPACE/install_icd/lib/libOpenCL.so \
-DOpenCL_INCLUDE_DIR=$GITHUB_WORKSPACE/install_headers/include \
-DCMAKE_CXX_COMPILER="$GITHUB_WORKSPACE/install_dpcpp/bin/clang++" \
-DCMAKE_CXX_FLAGS="--target=${{steps.calc_vars.outputs.arch}}-linux-gnu" \
-DCMAKE_CXX_LINK_FLAGS="-fuse-ld=lld"
ninja -C SYCL-CTS -v -j4 -k 0 || :

- name: package artefacts # package/unpackage avoids known 'permissions loss' issue
shell: bash
run: |
cd SYCL-CTS
# only bin
tar cf sycl-cts.tar bin

- name: upload artefact
uses: actions/upload-artifact@v4
with:
name: sycl_cts_${{inputs.target}}
path: SYCL-CTS/sycl-cts.tar
retention-days: 1

87 changes: 87 additions & 0 deletions .github/actions/run_sycl_cts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: run sycl cts
description: run sycl cts

inputs:
target:
description: 'target architecture'

runs:
using: "composite"
steps:
- name: calc vars
id: calc_vars
uses: ./.github/actions/calc_vars
with:
target: ${{ inputs.target }}

- name: Install Ninja
uses: llvm/actions/install-ninja@main

- name: download ock artifact
uses: actions/download-artifact@v4
with:
name: ock_${{inputs.target}}
path: install_ock

- name: download header artifact
uses: actions/download-artifact@v4
with:
name: header_${{inputs.target}}
path: install_headers

- name: download SYCL-CTS artifact
uses: actions/download-artifact@v4
with:
name: sycl_cts_${{inputs.target}}
path: SYCL-CTS

- name: unpackage SYCL-CTS artifacts # package/unpackage avoids known 'permissions loss' issue
shell: bash
run: |
cd SYCL-CTS
tar xf sycl-cts.tar
rm sycl-cts.tar

- name: download dpc++ artifact
uses: actions/download-artifact@v4
with:
name: dpcpp_${{inputs.target}}
path: install_dpcpp

- name: unpackage dpc++ artifacts # package/unpackage avoids known 'permissions loss' issue
shell: bash
run: |
cd install_dpcpp
tar xf dpcpp.tar
rm dpcpp.tar

- name: run sycl cts
shell: bash
env:
PREPEND_PATH: '' # TODO: have qemu as input and set up this
SYCL_CTS_TIMEOUT: '02:00:00'
SYCL_CTS_FILTER: ''
run: |
echo running sycl cts
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install_dpcpp/lib:$GITHUB_WORKSPACE/install_ock/lib
export ONEAPI_DEVICE_SELECTOR=opencl:0
export CTS_CSV_FILE=$GITHUB_WORKSPACE/.github/scripts/sycl-cts.csv
set -x
python $GITHUB_WORKSPACE/scripts/testing/run_cities.py \
--color=always \
--timeout $SYCL_CTS_TIMEOUT \
$PREPEND_PATH \
-p sycl_cts \
-b SYCL-CTS/bin \
-L SYCL-CTS/lib \
-e OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so \
-s $CTS_CSV_FILE \
-l SYCL-CTS/cts.log -f SYCL-CTS/cts.fail \
-r SYCL-CTS/cts.xml \
-v \
$SYCL_CTS_FILTER || exitcode=$?
export OCL_ICD_FILENAMES=$GITHUB_WORKSPACE/install_ock/lib/libCL.so
$GITHUB_WORKSPACE/.github/scripts/create_sycl_cts_test_lists.sh $PREPEND_PATH SYCL-CTS $CTS_CSV_FILE csv.txt cts_all.txt
# output a diff of the generated list csv.txt and cts_all.txt
diff csv.txt cts_all.txt || echo "WARNING - Missing some tests from sycl cts file based on test_all --list-tests - see > above"
exit $exitcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From: Harald van Dijk <[email protected]>
Date: Wed, 15 May 2024 17:57:47 +0100
Subject: [PATCH] Permit building for unknown architectures.

---
oclmath/fpcontrol.h | 6 +++---
oclmath/rounding_mode.cpp | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/oclmath/fpcontrol.h b/oclmath/fpcontrol.h
index cf9e9569..19a07655 100644
--- a/oclmath/fpcontrol.h
+++ b/oclmath/fpcontrol.h
@@ -69,7 +69,7 @@ inline void ForceFTZ(FPU_mode_type* mode) {
#elif defined(__mips__)
fpa_bissr(FPA_CSR_FS);
#else
-#error ForceFTZ needs an implentation
+#warning ForceFTZ needs an implentation
#endif
}

@@ -96,7 +96,7 @@ inline void DisableFTZ(FPU_mode_type* mode) {
#elif defined(__mips__)
fpa_bicsr(FPA_CSR_FS);
#else
-#error DisableFTZ needs an implentation
+#warning DisableFTZ needs an implentation
#endif
}

@@ -115,7 +115,7 @@ inline void RestoreFPState(FPU_mode_type* mode) {
#elif defined(__mips__)
// Mips runs by default with DAZ=1 FTZ=1
#else
-#error RestoreFPState needs an implementation
+#warning RestoreFPState needs an implementation
#endif
}
#else
diff --git a/oclmath/rounding_mode.cpp b/oclmath/rounding_mode.cpp
index 24e8ea99..bbac296b 100644
--- a/oclmath/rounding_mode.cpp
+++ b/oclmath/rounding_mode.cpp
@@ -217,7 +217,8 @@ void* FlushToZero(void) {
fpa_bissr(FPA_CSR_FS);
return NULL;
#else
-#error Unknown arch
+#warning Unknown arch
+ return NULL;
#endif
#else
#error Please configure FlushToZero and UnFlushToZero to behave properly on this operating system.
@@ -246,7 +247,7 @@ void UnFlushToZero(void* p) {
#elif defined(__mips__)
fpa_bicsr(FPA_CSR_FS);
#else
-#error Unknown arch
+#warning Unknown arch
#endif
#else
#error Please configure FlushToZero and UnFlushToZero to behave properly on this operating system.
--
2.43.0

Loading
Loading