-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add limited PR testing #101
base: main
Are you sure you want to change the base?
Changes from 16 commits
ade0355
9bdf9d7
f48ca12
1ed5bf7
3600d67
7a9c015
a1c47c0
dbcc599
5224126
9a30f34
1538717
4b640a4
c251e9c
60bd876
3807784
0eb4e97
17d07c9
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,71 @@ | ||
name: Hosted Runners (linux, CUDA) | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: nvidia/cuda:12.6.2-devel-ubuntu22.04 | ||
steps: | ||
- name: Install Packages | ||
run: > | ||
apt-get update && apt-get install | ||
-y --no-install-suggests --no-install-recommends | ||
cmake openmpi-bin libopenmpi-dev | ||
|
||
- name: Checkout Kokkos Tutorials | ||
uses: actions/checkout@v4 | ||
with: | ||
path: kokkos-tutorials | ||
|
||
- name: Checkout Kokkos | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'kokkos/kokkos' | ||
ref: master | ||
path: kokkos | ||
|
||
- name: Checkout Kokkos Kernels | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'kokkos/kokkos-kernels' | ||
ref: master | ||
path: kokkos-kernels | ||
|
||
- name: Configure Kokkos | ||
run: > | ||
cmake -S "${GITHUB_WORKSPACE}"/kokkos -B "${GITHUB_WORKSPACE}"/build-kokkos | ||
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}"/install-kokkos | ||
-DCMAKE_CXX_COMPILER="${GITHUB_WORKSPACE}"/kokkos/bin/nvcc_wrapper | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
-DKokkos_ENABLE_CUDA=ON | ||
-DKokkos_ARCH_AMPERE80=ON | ||
-DKokkos_ENABLE_COMPILER_WARNINGS=ON | ||
cwpearson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Build & Install Kokkos | ||
run: cmake --build "${GITHUB_WORKSPACE}"/build-kokkos --config RelWithDebInfo --parallel 2 --target install | ||
|
||
- name: Configure Kokkos Kernels | ||
run: > | ||
cmake -S "${GITHUB_WORKSPACE}"/kokkos-kernels -B "${GITHUB_WORKSPACE}"/build-kokkos-kernels | ||
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}"/install-kokkos-kernels | ||
-DCMAKE_CXX_COMPILER="${GITHUB_WORKSPACE}"/kokkos/bin/nvcc_wrapper | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
-DKokkos_ROOT="${GITHUB_WORKSPACE}"/install-kokkos | ||
|
||
- name: Build & Install Kokkos Kernels | ||
run: cmake --build "${GITHUB_WORKSPACE}"/build-kokkos-kernels --config RelWithDebInfo --parallel 2 --target install | ||
|
||
- name: Configure and Build Exercises | ||
run: | | ||
bash "${GITHUB_WORKSPACE}"/kokkos-tutorials/Scripts/ci-configure-build-test.sh \ | ||
"${GITHUB_WORKSPACE}"/install-kokkos/lib/cmake/Kokkos \ | ||
"${GITHUB_WORKSPACE}"/install-kokkos-kernels \ | ||
"${GITHUB_WORKSPACE}"/kokkos-tutorials \ | ||
"${GITHUB_WORKSPACE}"/kokkos/bin/nvcc_wrapper \ | ||
RelWithDebInfo \ | ||
CUDA |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Hosted Runners (unix) | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
cpp_compiler: g++ | ||
build_type: RelWithDebInfo | ||
backend: OPENMP | ||
- os: macos-latest | ||
cpp_compiler: clang++ | ||
build_type: Debug | ||
backend: THREADS | ||
|
||
steps: | ||
- name: Install Packages | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-suggests --no-install-recommends openmpi-bin libopenmpi-dev | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
brew install open-mpi | ||
fi | ||
shell: bash | ||
|
||
- name: Checkout Kokkos Tutorials | ||
uses: actions/checkout@v4 | ||
with: | ||
path: kokkos-tutorials | ||
|
||
- name: Checkout Kokkos | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'kokkos/kokkos' | ||
ref: master | ||
path: kokkos | ||
|
||
- name: Checkout Kokkos Kernels | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'kokkos/kokkos-kernels' | ||
ref: master | ||
path: kokkos-kernels | ||
|
||
- name: Configure Kokkos | ||
run: > | ||
cmake -S "${GITHUB_WORKSPACE}"/kokkos -B "${GITHUB_WORKSPACE}"/build-kokkos | ||
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}"/install-kokkos | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
-DKokkos_ENABLE_COMPILER_WARNINGS=ON | ||
|
||
- name: Build & Install Kokkos | ||
run: cmake --build "${GITHUB_WORKSPACE}"/build-kokkos --config ${{ matrix.build_type }} --parallel 2 --target install | ||
|
||
- name: Configure Kokkos Kernels | ||
run: > | ||
cmake -S "${GITHUB_WORKSPACE}"/kokkos-kernels -B "${GITHUB_WORKSPACE}"/build-kokkos-kernels | ||
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}"/install-kokkos-kernels | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
-DKokkos_ROOT="${GITHUB_WORKSPACE}"/install-kokkos | ||
|
||
- name: Build & Install Kokkos Kernels | ||
run: cmake --build "${GITHUB_WORKSPACE}"/build-kokkos-kernels --config ${{ matrix.build_type }} --parallel 2 --target install | ||
|
||
- name: Configure and Build Exercises | ||
run: | | ||
bash "${GITHUB_WORKSPACE}"/kokkos-tutorials/Scripts/ci-configure-build-test.sh \ | ||
"${GITHUB_WORKSPACE}"/install-kokkos/lib/cmake/Kokkos \ | ||
"${GITHUB_WORKSPACE}"/install-kokkos-kernels \ | ||
"${GITHUB_WORKSPACE}"/kokkos-tutorials \ | ||
${{ matrix.cpp_compiler}} \ | ||
${{ matrix.build_type}} \ | ||
${{ matrix.backend }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Hosted Runners (windows) | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
cpp_compiler: cl | ||
build_type: Release | ||
backend: SERIAL | ||
|
||
steps: | ||
- name: Checkout Kokkos Tutorials | ||
uses: actions/checkout@v4 | ||
with: | ||
path: kokkos-tutorials | ||
|
||
- name: Checkout Kokkos | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'kokkos/kokkos' | ||
ref: master | ||
path: kokkos | ||
|
||
- name: Configure Kokkos | ||
run: > | ||
cmake -S ${{ github.workspace}}\kokkos -B ${{ github.workspace}}\build-kokkos | ||
dalg24 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace}}\install-kokkos | ||
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build & Install Kokkos | ||
run: cmake --build ${{ github.workspace}}\build-kokkos --config ${{ matrix.build_type }} --parallel 2 --target install | ||
|
||
- name: Configure and Build Exercises | ||
run: | | ||
${{ github.workspace}}\kokkos-tutorials\Scripts\ci-configure-build-test.bat ^ | ||
${{ github.workspace}}\install-kokkos\lib\cmake\Kokkos ^ | ||
${{ github.workspace}}\kokkos-tutorials ^ | ||
${{ matrix.cpp_compiler}} ^ | ||
${{ matrix.build_type}} ^ | ||
${{ matrix.backend }} | ||
shell: cmd | ||
|
cwpearson marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
if "%~5"=="" ( | ||
echo Usage: build.bat kokkos_root tutorials_src cpp_compiler build_type backend | ||
exit /b 1 | ||
) | ||
|
||
set kokkos_root=%~1 | ||
set tutorials_src=%~2 | ||
set cpp_compiler=%~3 | ||
set build_type=%~4 | ||
set backend=%~5 | ||
|
||
set "EXERCISES=01 02 03" | ||
if "%backend%"=="CUDA" set "EXERCISES=%EXERCISES% 04" | ||
|
||
set Kokkos_ROOT=%kokkos_root% | ||
mkdir build 2>nul | ||
|
||
for %%e in (%EXERCISES%) do ( | ||
for %%k in (Begin Solution) do ( | ||
set "source_dir=%tutorials_src%\Exercises\%%e\%%k" | ||
set "build_dir=build\Exercises\%%e\%%k" | ||
echo building !source_dir! | ||
cmake -S "!source_dir!" -B "!build_dir!" ^ | ||
-DCMAKE_CXX_COMPILER="%cpp_compiler%" ^ | ||
-DCMAKE_BUILD_TYPE="%build_type%" | ||
|
||
cmake --build "!build_dir!" --config "%build_type%" | ||
) | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#! /bin/bash | ||
|
||
set -eou pipefail | ||
|
||
kokkos_root="$1" | ||
kernels_root="$2" | ||
tutorials_src="$3" | ||
cpp_compiler="$4" | ||
build_type="$5" | ||
backend="$6" | ||
|
||
# These are exercises with CMakeLists.txt in Begin and Solution subdirectories | ||
# TODO: advanced_reductions seems broken | ||
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. Can you elaborate? 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. Ah, |
||
# TODO: hpcbind does not use cmake | ||
# TODO: instances does not use cmake | ||
# TODO: parallel_scan seems broken | ||
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. Can you elaborate? 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. It just means there were compilation errors when I tried to compile it in this framework. I didn't spend more than 30s looking at any of them. I figured fixing them up could be follow-on work. 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. Yes, see #104. |
||
# TODO: simd_warp seems broken | ||
# TODO: subview seems broken | ||
# TODO: vectorshift needs Kokkos Remote Spaces | ||
# TODO: kokkoskernels/CGSolve_SpILUKprecond needs to know where Kokkos Kernels source directory is | ||
# TODO: kokkoskernels/SpILUK needs to know where Kokkos Kernels source directory is | ||
# TODO: kokkoskernels/TeamGemm seems broken | ||
# TODO: mpi_heat_conduction/no-mpi does not use cmake | ||
BEGIN_SOLUTION_EXERCISES=( | ||
01 | ||
02 | ||
03 | ||
dualview | ||
kokkoskernels/BlockJacobi | ||
kokkoskernels/GaussSeidel | ||
kokkoskernels/GraphColoring | ||
kokkoskernels/InnerProduct | ||
mdrange | ||
mpi_pack_unpack | ||
random_number | ||
scatter_view | ||
simd | ||
team_policy | ||
team_scratch_memory | ||
team_vector_loop | ||
unordered_map | ||
) | ||
|
||
if [ "$backend" == CUDA ]; then | ||
BEGIN_SOLUTION_EXERCISES+=(04) | ||
BEGIN_SOLUTION_EXERCISES+=(multi_gpu_cuda) | ||
fi | ||
|
||
|
||
if [ ! "$backend" == CUDA ]; then | ||
BEGIN_SOLUTION_EXERCISES+=(tasking) # tasking doesn't seem to work on CUDA | ||
BEGIN_SOLUTION_EXERCISES+=(virtualfunction) # TODO: virtualfunction needs Kokkos with CUDA RDC | ||
fi | ||
|
||
if [ "$backend" == OPENMP ]; then | ||
BEGIN_SOLUTIONS_EXERCISES+=(unique_token) | ||
fi | ||
|
||
# no fortran on macOs | ||
if [[ ! "$OSTYPE" == "darwin"* ]]; then | ||
BEGIN_SOLUTIONS_EXERCISES+=(fortran-kokkosinterface) | ||
fi | ||
|
||
# These are exercises with CMakeLists.txt in the root directory | ||
EXERCISES=( | ||
kokkoskernels/CGSolve/Solution # Begin does not include the proper headers (on purpose) so it can't be compiled | ||
kokkoskernels/SpGEMM/Solution # Begin does not include the proper headers (on purpose) so it can't be compiled | ||
mpi_exch | ||
tools_minimd | ||
) | ||
|
||
# TODO: explicitly specifies CUDA | ||
if [ "$backend" == CUDA ]; then | ||
EXERCISES+=(mpi_heat_conduction/Solution) # TODO: mpi_heat_conduction/Begin does not use cmake | ||
fi | ||
|
||
# Add Begin and Solution subdirectory from BEGIN_SOLUTION_EXCERCISES to EXERCISES | ||
for e in "${BEGIN_SOLUTION_EXERCISES[@]}"; do | ||
EXERCISES+=("$e"/Begin) | ||
EXERCISES+=("$e"/Solution) | ||
done | ||
|
||
export Kokkos_ROOT="$kokkos_root" | ||
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. Why do we handle Kokkos and KokkosKernels differently and why don't we just set these environment variable externally? |
||
mkdir -p build | ||
for e in "${EXERCISES[@]}"; do | ||
source_dir="$tutorials_src"/Exercises/"$e" | ||
build_dir=build/Exercises/"$e" | ||
echo building "$source_dir" | ||
cmake -S "$source_dir" -B "$build_dir" \ | ||
-DCMAKE_CXX_COMPILER="$cpp_compiler" \ | ||
-DCMAKE_BUILD_TYPE="$build_type" \ | ||
-DKokkosKernels_ROOT="$kernels_root" | ||
|
||
cmake --build "$build_dir" | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine but noting that it is the default hence unnecessary