-
Notifications
You must be signed in to change notification settings - Fork 186
Add recipe for O2 GPU CI tests #6264
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
Changes from all commits
e60699f
dd72bf2
ab2711b
02c2c5b
357736e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| package: O2-GPU-deterministic-test | ||
| version: "1.0" | ||
| requires: | ||
| - Vc | ||
| - boost | ||
| - fmt | ||
| - ms_gsl | ||
| - TBB | ||
| - ROOT | ||
| - ONNXRuntime | ||
| - GLFW | ||
| - gpu-system | ||
| build_requires: | ||
| - CMake | ||
| - Clang | ||
| - ninja | ||
| - alibuild-recipe-tools | ||
| license: GPL-3.0 | ||
| force_rebuild: true | ||
| --- | ||
| #!/bin/bash -e | ||
|
|
||
| if [[ -n ${GPU_SYSTEM_ROOT:-} && -f $GPU_SYSTEM_ROOT/etc/gpu-features-available.sh ]]; then | ||
| source $GPU_SYSTEM_ROOT/etc/gpu-features-available.sh | ||
| fi | ||
|
|
||
| if [[ -n ${O2GPUCI_BACKENDS:-} ]]; then | ||
| read -r -a GPU_BACKENDS <<< "${O2GPUCI_BACKENDS//,/ }" | ||
| else | ||
| GPU_BACKENDS=() | ||
| [[ ${O2_GPU_CUDA_AVAILABLE:-0} == 1 ]] && GPU_BACKENDS+=(CUDA) | ||
| [[ ${O2_GPU_ROCM_AVAILABLE:-0} == 1 ]] && GPU_BACKENDS+=(HIP) | ||
| fi | ||
|
|
||
| if [[ ${#GPU_BACKENDS[@]} == 0 ]]; then | ||
| echo "O2-GPU-deterministic-test: no GPU backend selected or detected." >&2 | ||
| echo "Set O2GPUCI_BACKENDS='CUDA,HIP' in CI to require both production GPU backends." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # HACK to find O2 sources without depending on O2 as a dependency (and potentially building all of it as a consequence) | ||
| O2_SOURCEDIR=${O2GPUCI_O2_SOURCEDIR:-} | ||
| for SOURCE_CANDIDATE in "$WORK_DIR/../O2" "$ALIBUILD_CONFIG_DIR/../AliceO2"; do | ||
| if [[ -z $O2_SOURCEDIR && -f $SOURCE_CANDIDATE/GPU/GPUTracking/Standalone/CMakeLists.txt ]]; then | ||
| O2_SOURCEDIR=$SOURCE_CANDIDATE | ||
| fi | ||
| done | ||
| if [[ -z $O2_SOURCEDIR && -d $WORK_DIR/SOURCES/O2 ]]; then | ||
| O2_SOURCEDIR=$(find "$WORK_DIR/SOURCES/O2" -mindepth 2 -maxdepth 2 -type d \ | ||
| -exec test -f '{}/GPU/GPUTracking/Standalone/CMakeLists.txt' \; -print -quit 2>/dev/null || true) | ||
| fi | ||
| if [[ ! -f $O2_SOURCEDIR/GPU/GPUTracking/Standalone/CMakeLists.txt ]]; then | ||
| echo "O2-GPU-deterministic-test: could not find the O2 source tree." >&2 | ||
| echo "Set O2GPUCI_O2_SOURCEDIR to the AliceO2 checkout used for this build." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| rm -Rf "$BUILDDIR/gpu-standalone-test" | ||
| mkdir -p "$BUILDDIR/gpu-standalone-test/build" "$BUILDDIR/gpu-standalone-test/install" | ||
| pushd "$BUILDDIR/gpu-standalone-test/build" | ||
|
|
||
| cp "$O2_SOURCEDIR/GPU/GPUTracking/Standalone/cmake/config.cmake" . | ||
| cat >> config.cmake <<'EoF' | ||
| set(GPUCA_BUILD_EVENT_DISPLAY 0) | ||
| set(GPUCA_DETERMINISTIC_MODE GPU) | ||
| set(GPUCA_DETERMINISTIC_NO_FTZ 1) | ||
| EoF | ||
|
|
||
| cmake -DCMAKE_INSTALL_PREFIX=../install "$O2_SOURCEDIR/GPU/GPUTracking/Standalone" | ||
| cmake --build . --target install -- ${JOBS:+-j $JOBS} | ||
|
|
||
| for BACKEND in "${GPU_BACKENDS[@]}"; do | ||
| ../install/ca --noEvents -g --gpuType "${BACKEND^^}" | ||
| done | ||
|
|
||
| popd | ||
| rm -Rf "$BUILDDIR/gpu-standalone-test" | ||
|
|
||
| # Dummy modulefile | ||
| mkdir -p "$INSTALLROOT/etc/modulefiles" | ||
| alibuild-generate-module > "$INSTALLROOT/etc/modulefiles/$PKGNAME" | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||
| package: O2-GPU-test | ||||
| version: "1.0" | ||||
| requires: | ||||
| - O2 | ||||
| - gpu-system | ||||
| build_requires: | ||||
| - alibuild-recipe-tools | ||||
| license: GPL-3.0 | ||||
| force_rebuild: true | ||||
| --- | ||||
| #!/bin/bash -e | ||||
|
|
||||
| if [[ -n ${GPU_SYSTEM_ROOT:-} && -f $GPU_SYSTEM_ROOT/etc/gpu-features-available.sh ]]; then | ||||
| source $GPU_SYSTEM_ROOT/etc/gpu-features-available.sh | ||||
| fi | ||||
|
|
||||
| rm -Rf $BUILDDIR/gpu-test | ||||
| mkdir $BUILDDIR/gpu-test | ||||
| pushd $BUILDDIR/gpu-test | ||||
|
|
||||
| if [[ -n ${O2GPUCI_BACKENDS:-} ]]; then | ||||
| read -r -a GPU_BACKENDS <<< "${O2GPUCI_BACKENDS//,/ }" | ||||
| else | ||||
| GPU_BACKENDS=() | ||||
| [[ ${O2_GPU_CUDA_AVAILABLE:-0} == 1 ]] && GPU_BACKENDS+=(CUDA) | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could add also OpenCL here, at least without processing events, but to check that it can start it up.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need PoCL for that? Or is the OpenCL runtime shipped with ROCm or CUDA enough to start the binary?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't compile for a device, any 3.x OpenCL runtime should be good enough.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried running with |
||||
| [[ ${O2_GPU_ROCM_AVAILABLE:-0} == 1 ]] && GPU_BACKENDS+=(HIP) | ||||
| fi | ||||
|
|
||||
| if [[ ${#GPU_BACKENDS[@]} == 0 ]]; then | ||||
| echo "O2-GPU-test: no GPU backend selected or detected." >&2 | ||||
| exit 1 | ||||
| fi | ||||
|
|
||||
| for BACKEND in "${GPU_BACKENDS[@]}"; do | ||||
| o2-gpu-standalone-benchmark --noEvents -g --gpuType "${BACKEND^^}" | ||||
| done | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking a bit. We can use the o2-gpu-standalone-benchmark for performance tests. But we also need a build with deterministic mode to compare CPU and GPU output.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a new recipe that builds the standalone binary in deterministic mode. It's kind of hacky because I'm compiling the binary in the test script and I have to guess the location of the O2 sources. But this avoids the RPATH issue, because it has it's own installation folder.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But this will be faulure-prone. From where do you take the O2 sources? From the O2 build? But it is not guaranteed that the O2 build happens before, it can for instance download a precompiled O2 tarball.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually thought about this again. Because the standalone test builds are only done in the CI, they will not be done for the tarballs we create, so actually O2 tarballs will not contain the standalone builds, even if we install them to the share folder in o2.sh.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, let's assume the sources are there for now. We will have some way of depending on sources at some point soon and then we can change. |
||||
|
|
||||
| popd | ||||
| rm -Rf $BUILDDIR/gpu-test | ||||
|
|
||||
| # Dummy modulefile | ||||
| mkdir -p $INSTALLROOT/etc/modulefiles | ||||
| alibuild-generate-module > $INSTALLROOT/etc/modulefiles/$PKGNAME | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package: O2GPUCI | ||
| version: "1.0.0" | ||
| tag: "O2GPUCI-1.0.0" | ||
| requires: | ||
| - O2 | ||
| - O2-GPU-test:(.*x86-64) | ||
| - O2-GPU-deterministic-test:(.*x86-64) | ||
| build_requires: | ||
| - alibuild-recipe-tools | ||
| license: GPL-3.0 | ||
| valid_defaults: | ||
| - o2 | ||
| - o2-epn | ||
| - ali | ||
| --- | ||
| #!/bin/bash -ex | ||
|
|
||
| # Modulefile | ||
| mkdir -p $INSTALLROOT/etc/modulefiles | ||
| alibuild-generate-module > $INSTALLROOT/etc/modulefiles/$PKGNAME |
Uh oh!
There was an error while loading. Please reload this page.