-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from icl-utk-edu/gragghia/ci_spack
Adding new files for github actions testing of spack package
- Loading branch information
Showing
5 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash -e | ||
|
||
bstage=$1 | ||
device=$2 | ||
|
||
set +x | ||
trap 'echo "# $BASH_COMMAND"' DEBUG | ||
|
||
source /etc/profile | ||
|
||
COMPILER=gcc@11 | ||
MPI=intel-oneapi-mpi | ||
BLAS=intel-oneapi-mkl | ||
|
||
# Get the system-install ROCM version | ||
ROCM_VER=$(ls /opt | grep rocm- | sed s/rocm-//) | ||
# Get the system-install CUDA version | ||
CUDA_VER=$(cd /usr/local && ls -d cuda-*.* | sed "s/cuda-//") | ||
|
||
if [ "${bstage}" = "deps" ]; then | ||
git clone https://github.com/spack/spack | ||
cp .github/workflows/spack_packages_yaml spack/etc/spack/packages.yaml | ||
# Use $ROCM_VER in the spack package config | ||
sed -i "s/ROCMVER/$ROCM_VER/" spack/etc/spack/packages.yaml | ||
# Use $CUDA_VER in the spack package config | ||
sed -i "s/CUDAVER/$CUDA_VER/" spack/etc/spack/packages.yaml | ||
fi | ||
|
||
export HOME=$(pwd) | ||
source spack/share/spack/setup-env.sh | ||
module load $COMPILER | ||
spack compiler find --scope=site | ||
|
||
if [ "${device}" = "cpu" ]; then | ||
SPEC="" | ||
elif [ "${device}" = "gpu_nvidia" ]; then | ||
ARCH=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader | head -1 | sed -e 's/\.//') | ||
SPEC="+cuda cuda_arch=$ARCH" | ||
elif [ "${device}" = "gpu_amd" ]; then | ||
TARGET=$(rocminfo | grep Name | grep gfx | head -1 | awk '{print $2}') | ||
SPEC="+rocm amdgpu_target=$TARGET ^hip@$ROCM_VER" | ||
else | ||
SPEC="+sycl" | ||
COMPILER=oneapi | ||
module load intel-oneapi-compilers | ||
spack compiler find --scope=site | ||
fi | ||
SPEC="slate@master $SPEC %$COMPILER ^$MPI ^$BLAS" | ||
echo SPEC=$SPEC | ||
|
||
if [ "${bstage}" = "deps" ]; then | ||
# Change the stage directory so we can find it later | ||
spack config --scope=site add config:build_stage:`pwd`/spack-stage | ||
spack spec $SPEC | ||
spack install --only=dependencies --fail-fast $SPEC | ||
elif [ "${bstage}" = "build" ]; then | ||
spack dev-build -i $SPEC | ||
elif [ "${bstage}" = "test" ]; then | ||
spack uninstall -y slate | ||
spack dev-build --test=root $SPEC || ( | ||
cat spack-stage/github/spack-stage-slate-master-*/install-time-test-log.txt | ||
exit 22 | ||
) | ||
elif [ "${bstage}" = "smoke" ]; then | ||
spack test run slate | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Spack | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
slate_spack: | ||
timeout-minutes: 360 | ||
strategy: | ||
matrix: | ||
device: [gpu_nvidia, gpu_amd, cpu] | ||
fail-fast: false | ||
runs-on: ${{ matrix.device }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build Dependencies | ||
run: .github/workflows/spack.sh deps ${{matrix.device}} | ||
- name: Build SLATE | ||
run: .github/workflows/spack.sh build ${{matrix.device}} | ||
- name: Pre-install Test | ||
run: .github/workflows/spack.sh test ${{matrix.device}} | ||
- name: Post-install Test | ||
run: .github/workflows/spack.sh smoke ${{matrix.device}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
packages: | ||
all: | ||
target: ['x86_64'] | ||
cuda: | ||
buildable: false | ||
externals: | ||
- spec: cuda@CUDAVER | ||
prefix: /usr/local/cuda-CUDAVER/ | ||
hip: | ||
buildable: false | ||
externals: | ||
- spec: hip@ROCMVER | ||
prefix: /opt/rocm-ROCMVER/ | ||
rocblas: | ||
buildable: false | ||
externals: | ||
- spec: rocblas@ROCMVER | ||
prefix: /opt/rocm-ROCMVER/rocblas/ | ||
llvm-amdgpu: | ||
buildable: false | ||
externals: | ||
- spec: llvm-amdgpu@ROCMVER | ||
prefix: /opt/rocm-ROCMVER | ||
comgr: | ||
buildable: false | ||
externals: | ||
- spec: comgr@ROCMVER | ||
prefix: /opt/rocm-ROCMVER | ||
rocsolver: | ||
buildable: false | ||
externals: | ||
- spec: rocsolver@ROCMVER | ||
prefix: /opt/rocm-ROCMVER/rocsolver | ||
hsa-rocr-dev: | ||
buildable: false | ||
externals: | ||
- spec: hsa-rocr-dev@ROCMVER | ||
prefix: /opt/rocm-ROCMVER/hsa/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters