Skip to content

Commit

Permalink
Add libCEED, GAMESS to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelesko committed May 23, 2024
1 parent ac2a95b commit cad283c
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 81 deletions.
156 changes: 90 additions & 66 deletions .github/workflows/check-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,83 +11,107 @@ concurrency:
cancel-in-progress: true

jobs:
unit-tests-llvm-15-debug:
# unit-tests-llvm-15-debug:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh debug llvm-15
# shell: bash
# unit-tests-llvm-15-release:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh release llvm-15
# shell: bash
# unit-tests-llvm-16-debug:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh debug llvm-16
# shell: bash
# unit-tests-llvm-16-release:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh release llvm-16
# shell: bash
# unit-tests-llvm-17-debug:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh debug llvm-17
# shell: bash
# unit-tests-llvm-17-release:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh release llvm-17
# shell: bash
# unit-tests-llvm-18-debug:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh debug llvm-18
# shell: bash
# unit-tests-llvm-18-release:
# runs-on: self-hosted
# steps:
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Run unit test checking script
# run: ./scripts/unit_tests.sh release llvm-18
# shell: bash
test-gamess:
runs-on: self-hosted
needs: []
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh debug llvm-15
- name: Run GAMESS test script
run: ./scripts/test_gamess.sh
shell: bash
unit-tests-llvm-15-release:
test-libceed:
runs-on: self-hosted
needs: []
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh release llvm-15
- name: Run LibCEED test script
run: ./scripts/test_libceed.sh
shell: bash
unit-tests-llvm-16-debug:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh debug llvm-16
shell: bash
unit-tests-llvm-16-release:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh release llvm-16
shell: bash
unit-tests-llvm-17-debug:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh debug llvm-17
shell: bash
unit-tests-llvm-17-release:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh release llvm-17
shell: bash
unit-tests-llvm-18-debug:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh debug llvm-18
shell: bash
unit-tests-llvm-18-release:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run unit test checking script
run: ./scripts/unit_tests.sh release llvm-18
shell: bash

# needs: [unit-tests-llvm-15-debug, unit-tests-llvm-15-release, unit-tests-llvm-16-debug, unit-tests-llvm-16-release, unit-tests-llvm-17-debug, unit-tests-llvm-17-release, unit-tests-llvm-18-debug, unit-tests-llvm-18-release]
2 changes: 1 addition & 1 deletion H4I-MKLShim
Submodule H4I-MKLShim updated 0 files
7 changes: 7 additions & 0 deletions cmake/hip-config-in.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ if(WIN32)
message(FATAL_ERROR "Windows not yet supported for chipStar")
endif()

set(HIP_VERSION "@HIP_VERSION@" CACHE STRING "hip version")
set(HIP_VERSION_MAJOR "@HIP_VERSION_MAJOR@" CACHE STRING "hip major version")
set(HIP_VERSION_MINOR "@HIP_VERSION_MINOR@" CACHE STRING "hip minor version")
set(HIP_VERSION_PATCH "@HIP_VERSION_PATCH@" CACHE STRING "hip patch version")

set(HIP_PATH "@HIP_PATH@" CACHE PATH "Path to the chipStar installation")
set(HIP_COMPILER "@HIP_COMPILER@" CACHE STRING "C++ compiler")
set(HIP_RUNTIME "@HIP_RUNTIME@" CACHE STRING "" FORCE)
Expand Down Expand Up @@ -161,3 +166,5 @@ set(HIP_LIBRARIES ${hip_LIBRARIES})
set(HIP_LIBRARY ${hip_LIBRARY})
set(HIP_HIPCC_EXECUTABLE ${hip_HIPCC_EXECUTABLE})
set(HIP_HIPCONFIG_EXECUTABLE ${hip_HIPCONFIG_EXECUTABLE})


1 change: 1 addition & 0 deletions scripts/compile_libceed.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source /etc/profile.d/modules.sh &> /dev/null
module use ~/modulefiles
HIP_DIR=$1
echo "Building LibCEED with HIP_DIR: ${HIP_DIR}"
if which clang >/dev/null 2>&1; then
Expand Down
55 changes: 55 additions & 0 deletions scripts/test_gamess.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
set -ex

source /etc/profile.d/modules.sh &> /dev/null
module use ~/modulefiles

cd /home/pvelesko/GAMESS/gamess_libcchem_hip

export IGC_EnableDPEmulation=1
export OverrideDefaultFP64Settings=1

module purge
module load llvm/18.0
module load HIP/chipStar/testing
module load hdf5/1.14.4.2
module load openmpi/4.1.1
module load HipSolver/2024.05.15-807efe2

export JSON_ROOT=$PWD/../json
export MATHLIB_ROOT=$HIP_DIR
export GPU_BOARD=Intel
export OMP_NUM_THREADS=1

export MPI_CXX=mpic++
rm -rf build && mkdir build && cd build
cmake -DMPI_ROOT=$MPI_ROOT -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++ -DJSON_ROOT=$JSON_ROOT -DHDF5_ROOT=$HDF5_ROOT -DHIP=True -DMATHLIB_ROOT=$MATHLIB_ROOT -DHIPSOLVER_ROOT=$HIPSOLVER_ROOT -DBUILD_RIMP2=0 -DMAGMA=False -DGPU_BOARD=$GPU_BOARD -DMKLROOT=$MKLROOT ../
make -j $(nproc)
cd ..

export IGC_ForceOCLSIMDWidth=16
#export ZE_AFFINITY_MASK=0.0

orterun --mca btl vader,self,tcp -np 2 --bind-to core --map-by ppr:2:node ./build/exess ./inputs/json_inputs/scf/w1.json 2>&1 | tee gamess_output.txt

# Extract the floating point number from the output file
energy=$(grep "Final energy is:" gamess_output.txt | awk '{print $4}')
correct_energy=-74.9612532341291

# Define the tolerance value
tol=0.0001

# Calculate the absolute difference between the energy and the correct energy
diff=$(echo "$energy - $correct_energy" | bc | tr -d -)

# Compare the absolute difference with the tolerance value
comparison=$(echo "$diff < $tol" | bc)

if [ $comparison -eq 1 ]
then
echo "The energy value is within the tolerance."
exit 0
else
echo "The energy value is not within the tolerance."
exit 1
fi
29 changes: 29 additions & 0 deletions scripts/test_libceed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -ex

source /etc/profile.d/modules.sh &> /dev/null
module use ~/modulefiles

export IGC_EnableDPEmulation=1
export OverrideDefaultFP64Settings=1
export CHIP_LOGLEVEL=err

module purge
module load llvm/18.0
module load HIP/chipStar/testing

cd /home/pvelesko/libCEED
git co HEAD -f
git pull
make clean

make FC= CC=hipcc CXX=hipcc BACKENDS="/gpu/hip/ref /gpu/hip/shared /gpu/hip/gen" -j $(nproc) test | tee libceed_output.txt
if grep -q "not ok" "libceed_output.txt"; then
echo "FAIL"
awk '/Test Summary Report/,EOF' "libceed_output.txt"
exit 1
else
echo "PASS"
exit 0
fi
16 changes: 2 additions & 14 deletions scripts/unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,45 +144,34 @@ else
mkdir build
cd build

export CHIPSTAR_INSTALL_DIR=/home/pvelesko/install/HIP/chipStar/testing # set CHIPSTAR_INSTALL_DIR to current build dir
echo "building with $CLANG"
cmake ../ -DCMAKE_BUILD_TYPE="$build_type" -DCHIP_BUILD_HIPBLAS=ON
cmake ../ -DCMAKE_BUILD_TYPE="$build_type" -DCHIP_BUILD_HIPBLAS=ON -DCMAKE_INSTALL_PREFIX=${CHIPSTAR_INSTALL_DIR}
make all build_tests install -j $(nproc) #&> /dev/null
echo "chipStar build complete."
fi

module unload opencl/dgpu

# module load HIP/hipBLAS/main/release # for libCEED NOTE: Must be after build step otherwise it will cause link issues.

# Test Level Zero iGPU
echo "begin igpu_level0_failed_tests"
# module load level-zero/igpu
# module list
../scripts/check.py ./ igpu level0 --num-threads=${num_threads} --timeout=$timeout --num-tries=$num_tries --modules=on | tee igpu_level0_make_check_result.txt
# module unload level-zero/igpu
echo "end igpu_level0_failed_tests"

# Test Level Zero dGPU
echo "begin dgpu_level0_failed_tests"
# module load level-zero/dgpu
# module list
../scripts/check.py ./ dgpu level0 --num-threads=${num_threads} --timeout=$timeout --num-tries=$num_tries --modules=on | tee dgpu_level0_make_check_result.txt
# module unload level-zero/dgpu
echo "end dgpu_level0_failed_tests"

# Test OpenCL iGPU
echo "begin igpu_opencl_failed_tests"
# module load opencl/igpu
# module list
../scripts/check.py ./ igpu opencl --num-threads=${num_threads} --timeout=$timeout --num-tries=$num_tries --modules=on | tee igpu_opencl_make_check_result.txt
# module unload opencl/igpu
echo "end igpu_opencl_failed_tests"

# Test OpenCL dGPU
echo "begin dgpu_opencl_failed_tests"
# module load intel/opencl # sets ICD
# module load opencl/dgpu # sets CHIP_BE
# module list
../scripts/check.py ./ dgpu opencl --num-threads=${num_threads} --timeout=$timeout --num-tries=$num_tries --modules=on | tee dgpu_opencl_make_check_result.txt
# module unload opencl/dgpu intel/opencl
echo "end dgpu_opencl_failed_tests"
Expand All @@ -198,7 +187,6 @@ function check_tests {
return 1
fi
}

overall_status=0
set +e
echo "RESULTS:"
Expand Down

0 comments on commit cad283c

Please sign in to comment.