diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..49e967d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +**/kokkos-* +**/kernels-* +**/*_run +**/*_build \ No newline at end of file diff --git a/frontier/download.sh b/frontier/download.sh new file mode 100755 index 0000000..12c5ea2 --- /dev/null +++ b/frontier/download.sh @@ -0,0 +1,43 @@ +#! /bin/bash + +set -eou pipefail + +source "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/env.sh + +LOG_DIR="$(date +"%Y%m%d_%H%M%S")_build" +export LOG_DIR +mkdir -p "$LOG_DIR" + +git clone git@github.com:kokkos/kokkos.git "$KOKKOS_SRC" || true +(cd "$KOKKOS_SRC" && git checkout $KOKKOS_SHA) || true + +git clone git@github.com:kokkos/kokkos-kernels.git "$KERNELS_SRC" || true +(cd "$KERNELS_SRC" && git checkout $KERNELS_SHA) || true + +srun -n1 -t 1 module list |& tee "$LOG_DIR/module-list.log" +srun -n1 -t 1 lscpu |& tee "$LOG_DIR/lscpu.log" +srun -n1 -t 1 hostname |& tee "$LOG_DIR/hostname.log" + +## Configure Kokkos +cmake -S "$KOKKOS_SRC" -B "$KOKKOS_BUILD" \ +-DCMAKE_INSTALL_PREFIX="$KOKKOS_INSTALL" \ +-DCMAKE_CXX_STANDARD=17 \ +-DCMAKE_BUILD_TYPE=Release \ +-DCMAKE_CXX_COMPILER=CC \ +-DKokkos_ENABLE_HIP=ON \ +-DKokkos_ARCH_NATIVE=ON \ +-DKokkos_ARCH_AMD_GFX90A=ON + +## Build & Install Kokkos +cmake --build "$KOKKOS_BUILD" -j "$(nproc)" -t install + +## Configure Kernels +cmake -S "$KERNELS_SRC" -B "$KERNELS_BUILD" \ +-DKokkos_DIR="$KOKKOS_INSTALL/lib64/cmake/Kokkos" \ +-DCMAKE_BUILD_TYPE=Release \ +-DCMAKE_CXX_COMPILER=CC \ +-DKokkosKernels_ENABLE_TPL_ROCSPARSE=ON \ +-DKokkosKernels_ENABLE_TPL_ROCBLAS=ON \ + +## Build Kernels +cmake --build "$KERNELS_BUILD" -j "$(nproc)" \ No newline at end of file diff --git a/frontier/env.sh b/frontier/env.sh new file mode 100644 index 0000000..27f6c3c --- /dev/null +++ b/frontier/env.sh @@ -0,0 +1,12 @@ +export ROOT_DIR=/lustre/orion/csc465/scratch/cpearson/kug-2023 + +export KOKKOS_SHA=f8788ef2ae1940b627cc6ebc6abeef2c34e7e8dc # 2023 11 30 +export KOKKOS_SRC="$ROOT_DIR/kokkos-${KOKKOS_SHA:0:8}" +export KOKKOS_BUILD="$ROOT_DIR/kokkos-build-${KOKKOS_SHA:0:8}" +export KOKKOS_INSTALL="$ROOT_DIR/kokkos-install-${KOKKOS_SHA:0:8}" + +export KERNELS_SHA=a80eb9114ddda2d9454e4f3cc8a3dd5143ecdfc8 # 2023 11 30 +export KERNELS_SRC="$ROOT_DIR/kernels-${KERNELS_SHA:0:8}" +export KERNELS_BUILD="$ROOT_DIR/kernels-build-${KERNELS_SHA:0:8}" + +module load PrgEnv-amd \ No newline at end of file diff --git a/frontier/run.sh b/frontier/run.sh new file mode 100755 index 0000000..89174dc --- /dev/null +++ b/frontier/run.sh @@ -0,0 +1,24 @@ +#! /bin/bash +#SBATCH -A csc465 +#SBATCH -N 1 + +set -eou pipefail + +source "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/env.sh + +LOG_DIR="$(date +"%Y%m%d_%H%M%S")_run" +export LOG_DIR +mkdir -p "$LOG_DIR" + +srun -n1 -t 1 /opt/rocm-5.7.0/bin/rocm-smi \ + --showdriverversion \ + --showproductname \ + --showmclkrange \ + -v \ + --showsclkrange \ + --showfwinfo \ + |& tee "$LOG_DIR/rocm-smi.log" || true +srun -n1 -t 1 /opt/rocm-5.7.0/bin/rocminfo |& tee "$LOG_DIR/rocminfo.log" || true +srun -n1 -t 1 lscpu |& tee "$LOG_DIR/lscpu.log" || true +srun -n1 -t 1 hostname |& tee "$LOG_DIR/hostname.log" || true +srun -n1 -t 1 cat /proc/cpuinfo |& tee "$LOG_DIR/cpuinfo.log" || true \ No newline at end of file