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 38 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
125 changes: 125 additions & 0 deletions .github/actions/do_build_dpcpp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: build dpc++
description: build dpc++

inputs:
target:
description: 'target architecture'
build:
description: 'build not download'
type: boolean
default: true

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.build == 'true'
uses: actions/checkout@v4
with:
repository: intel/llvm
path: llvm

- name: dpcpp configure
if: inputs.build == 'true'
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.build == 'true'
shell: bash
run:
cmake --build llvm/build -- sycl-headers

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

- name: build extra utilties
if: inputs.build == '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.
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.build == 'true'
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

# - name: install config files to pick up libraries for cross compilation.
# if: inputs.build == 'true'
# 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.build == 'false'
alan-forbes-cp marked this conversation as resolved.
Show resolved Hide resolved
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: |
pwd
echo $GITHUB_WORKSPACE
ls -laR $GITHUB_WORKSPACE
cd llvm/build/install
echo LISTING
ls -la
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
113 changes: 113 additions & 0 deletions .github/actions/do_build_sycl_cts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
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
echo LISTING
ls -la
tar xf dpcpp.tar
rm dpcpp.tar
echo LISTING
ls -la

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

- name: build SYCL CTS
shell: bash
run: |
echo SWAP LOGGING START
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
df -h
sudo swapon --show
set +x
echo SWAP LOGGING END
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
# TODO: REMOVE EXCLUSIONS
# build only accessor_basic for now
printf "accessor_basic" > $GITHUB_WORKSPACE/EXCLUSIONS
#printf "accessor_generic\naccessor_legacy\naccessor_placeholder\naddress_space\natomic\natomic_fence\natomic_ref\natomic_ref_stress\nbit_cast\nbuffer\ncommon\ncontext\ncuda_interop\ndevice\ndevice_event\ndevice_selector\nerror\nevent\nexception_handling\nexceptions\nextension\nfull_feature_set\nfunction_objects\ngroup\ngroup_functions\nh_item\nhandler\nheader\nhierarchical\nhost_accessor\nhost_task\nid\nimage\nimage_accessor\ninvoke\nis_device_copyable\nitem\nkernel\nkernel_args\nkernel_bundle\nlanguage\nlocal_accessor\nmarray_arithmetic_assignment\nmarray_arithmetic_binary\nmarray_basic\nmarray_bitwise\nmarray_pre_post\nmarray_relational\nmath_builtin_api\nmulti_ptr\nnamespace\nnd_item\nnd_range\nopencl_interop\noptional_kernel_features\nplatform\npointers\nproperty\nqueue\nrange\nreduction\nsampler\nscalars\nspec_constants\nstream\nsub_group\nsycl_external\nusm\nvector_alias\nvector_api\nvector_constructors\nvector_deduction_guides\nvector_load_store\nvector_operators\nvector_swizzle_assignment\nvector_swizzles\n" > $GITHUB_WORKSPACE/EXCLUSIONS
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" \
-DSYCL_CTS_EXCLUDE_TEST_CATEGORIES=$GITHUB_WORKSPACE/EXCLUSIONS
#TODO: ninja KILLS RUNNER WHEN ALL TEST CATEGORIES ARE 'LIVE'
# fyi this made no difference:
# ninja -C SYCL-CTS -v -l 2.5 -k 0 || :
#ninja -C SYCL-CTS -v -j8 -k 0 || :
ninja -C SYCL-CTS -v -j4 -k 0 || :

- name: package artefacts # package/unpackage avoids known 'permissions loss' issue
shell: bash
run: |
cd SYCL-CTS
echo LISTING
ls -la
# TODO: 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

99 changes: 99 additions & 0 deletions .github/actions/run_sycl_cts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
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
echo LISTING
ls -la
tar xf sycl-cts.tar
rm sycl-cts.tar
echo LISTING
ls -la

- 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
echo LISTING
ls -la
tar xf dpcpp.tar
rm dpcpp.tar
echo LISTING
ls -la

- 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: '' # TODO: needed? Is this effectively INCLUSIONS (when all build) ??
run: |
pwd && ls -laR && sleep 2
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 # can't set in env:
# TODO: assume sycl-cts.csv is a new file?
# SYCL-CTS/lib does not exist?
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=$?
# TODO: Restore the following shell script - appears to need runs including ALL test categories
#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
Loading
Loading