Skip to content

Commit

Permalink
ci: tests should be built without -O0
Browse files Browse the repository at this point in the history
Tests should make sure real use cases work as expected. Some tests might
not working correctly if -O0 is used as optimization level in the
compiler. For example, the ROCm runtime submits a kernel of 4 waves if
the tests are built using -O0, which makes the tests fail.
  • Loading branch information
gcongiu committed Dec 5, 2023
1 parent ef1cc48 commit 81d65bf
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci_nodbg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash -e

COMPONENT=$1
COMPILER=$2

[ -z "$COMPILER" ] && COMPILER=gcc@11

source /etc/profile
set +x
set -e
trap 'echo "# $BASH_COMMAND"' DEBUG
shopt -s expand_aliases

module load $COMPILER

cd src

if [ "$COMPONENT" = "lmsensors" ]; then
wget https://github.com/groeck/lm-sensors/archive/V3-4-0.tar.gz
tar -zxf V3-4-0.tar.gz
cd lm-sensors-3-4-0
make install PREFIX=../lm ETCDIR=../lm/etc
cd ..
export PAPI_LMSENSORS_ROOT=lm
export PAPI_LMSENSORS_INC=$PAPI_LMSENSORS_ROOT/include/sensors
export PAPI_LMSENSORS_LIB=$PAPI_LMSENSORS_ROOT/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_LMSENSORS_ROOT/lib
fi

if [ "$COMPONENT" = "cuda" ] || [ "$COMPONENT" = "nvml" ]; then
module load cuda
export PAPI_CUDA_ROOT=$ICL_CUDA_ROOT
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PAPI_CUDA_ROOT/extras/CUPTI/lib64
fi

if [ "$COMPONENT" = "rocm" ] || [ "$COMPONENT" = "rocm_smi" ]; then
export PAPI_ROCM_ROOT=`ls -d /opt/rocm-*`
export PAPI_ROCMSMI_ROOT=$PAPI_ROCM_ROOT/rocm_smi
fi

if [ "$COMPONENT" = "infiniband_umad" ]; then
export PAPI_INFINIBAND_UMAD_ROOT=/usr
fi

if [ "$COMPONENT" = "perf_event" ]; then
./configure --enable-warnings
else
./configure --enable-warnings --with-components=$COMPONENT
fi

make -j4

utils/papi_component_avail

# Make sure the $COMPONENT is active
utils/papi_component_avail | grep -A1000 'Active components' | grep -q "Name: $COMPONENT "

if [ "$COMPONENT" != "cuda" ]; then
echo Testing
./run_tests.sh
fi
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,36 @@ jobs:
with:
name: clang-analysis-output
path: src/clang-analysis-output
papi_component_nodbg:
strategy:
matrix:
component: [perf_event, lmsensors, io, net, powercap, appio, coretemp, stealtime]
fail-fast: false
runs-on: cpu_intel
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Test
run: .github/workflows/ci_nodbg.sh ${{matrix.component}}
papi_component_nvidia_nodbg:
strategy:
matrix:
component: [cuda, nvml]
fail-fast: false
runs-on: gpu_nvidia
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Test
run: .github/workflows/ci_nodbg.sh ${{matrix.component}}
papi_component_amd_nodbg:
strategy:
matrix:
component: [rocm, rocm_smi]
fail-fast: false
runs-on: gpu_amd
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Test
run: .github/workflows/ci_nodbg.sh ${{matrix.component}}

0 comments on commit 81d65bf

Please sign in to comment.