Skip to content

Add the dynamic parallelism config to the triangle counting lab #14

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions labs/triangle_counting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,9 @@ docker build . -t raiproject/pumps2018:triangle-counting-amd64-cuda100
docker push raiproject/pumps2018:triangle-counting-amd64-cuda100
```

## Enabling Dynamic Parallelism
Please override the configurations files with the files in dynamic\_parallelism\_enabled. In the new CMakeLists.txt, make sure the following line reflect the compute capability of the device RAI uses. For example, V100 is corresponding to 7.0 and that means you don't need to make changes.

```
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_70,code=sm_70;)
```
81 changes: 81 additions & 0 deletions labs/triangle_counting/dynamic_parallel_enabled/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
include(cmake/HunterGate.cmake)

# use config in cmake/Hunter/config.cmake
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.112.tar.gz"
SHA1 "4b894e1d5d203f0cc9a77431dbb1b486ab6f4430"
LOCAL
)

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)



project(tc LANGUAGES CXX CUDA)


#include(FindCUDA/select_compute_arch)
find_package(CUDAToolkit REQUIRED)
#find_package(CUDA REQUIRED)

hunter_add_package(fmt)
hunter_add_package(spdlog)
find_package(spdlog CONFIG REQUIRED)
hunter_add_package(cub)
find_package(cub CONFIG REQUIRED)
hunter_add_package(Catch)
find_package(pangolin CONFIG REQUIRED)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(VERBOSE_BUILD ON)
set(DEFAULT_BUILD_TYPE "Release")




set_property(GLOBAL PROPERTY USE_FOLDERS ON)

include(CTest)

add_executable(tc
eval.cu
helper.hpp
template.cu
template.hu
common/catch.hpp
common/clara.hpp
common/utils.hpp
)


if(DEFINED GRAPH_PREFIX_PATH)
message(STATUS "compiling with GRAPH_PREFIX_PATH=${GRAPH_PREFIX_PATH}")
target_compile_definitions(tc PRIVATE GRAPH_PREFIX_PATH=${GRAPH_PREFIX_PATH})
else()
message(FATAL_ERROR "please define GRAPH_PREFIX_PATH")
endif()

#CUDA_SELECT_NVCC_ARCH_FLAGS(CUDA_ARCH_FLAGS Auto)
#list(APPEND CUDA_NVCC_FLAGS ${CUDA_ARCH_FLAGS})
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_70,code=sm_70;)

target_compile_features(tc PUBLIC cxx_std_11)

target_compile_options(tc PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:${CUDA_NVCC_FLAGS}>)
set_target_properties( tc PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
#CUDA_RESOLVE_DEVICE_SYMBOLS ON
)

target_link_libraries(tc pangolin::pangolin32 ${CUDA_cudadevrt_LIBRARY} ${CUDA_LIBRARIES})

# target_link_options(tc PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:${CUDA_NVCC_FLAGS}>)


include_directories(tc
${PROJECT_SOURCE_DIR}/src
${CUDA_INCLUDE_DIRS}
)

enable_testing()
20 changes: 20 additions & 0 deletions labs/triangle_counting/dynamic_parallel_enabled/rai_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# lab: Triangle Counting
rai:
version: 0.2
image: tonywukun/pumps2018:triangle-counting-amd64-cuda100-cmake3.9test2
resources:
cpu:
architecture: amd64
gpu:
count: 1
limits:
network: true
commands:
build:
- cp -r /src . # ensure source code is in upload folder
- /root/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-7.3.0/cmake-3.26.3-yuk5ln5gyf345uqiqb44jzuzaczldhz2/bin/cmake /src -DCMAKE_PREFIX_PATH=${PANGOLIN_INSTALL_DIR} -DGRAPH_PREFIX_PATH=\"/graphs\"
#- /root/spack/opt/spack/linux-ubuntu18.04-skylake/gcc-7.3.0/cmake-3.9.6-nsyti5bha6bunwre2xxkbw5j3aplpx7o/bin/cmake /src -DCMAKE_PREFIX_PATH=${PANGOLIN_INSTALL_DIR} -DGRAPH_PREFIX_PATH=\"/graphs\"
- make VERBOSE=1
- ./tc -c LINEAR
- ./tc -c OTHER