-
Notifications
You must be signed in to change notification settings - Fork 407
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
RULE_LAUNCH_COMPILE and RULE_LAUNCH_LINK system for nvcc_wrapper #3136
Conversation
617b330
to
96dc78c
Compare
Oh and in all the CUDA tests, it will still be using the |
c677aba
to
d732854
Compare
@dalg24 This should now provide this exact same behavior if Before this is merged, Jenkins needs to have new instances of all tests with |
There still is
|
@masterleinad I really need to finished that PR for CDash... if only @dalg24 wasn't so damn picky... I have no idea where that error is in the log. Did that happen in the build tree or in the install tree? |
It's in the build step for |
Thanks, I think just needed logic for Clang |
The architecture auto-detection fails (maybe unsurprisingly) with
|
Oh, well this isn't too complicated of a fix. IF(KOKKOS_ENABLE_CUDA AND NOT CUDA_ARCH_ALREADY_SPECIFIED)
TRY_RUN(
_RESULT
_COMPILE_RESULT
${_BINARY_TEST_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/compile_tests/cuda_compute_capability.cc
COMPILE_DEFINITIONS -DSM_ONLY
RUN_OUTPUT_VARIABLE _CUDA_COMPUTE_CAPABILITY)
ENDIF() I don't see a way to tell cmake to use the launcher so just need to either:
@masterleinad @jjwilke Thoughts? Preferences? |
Currently, the auto-detection doesn't work with AFAICT, |
@masterleinad Been too busy lately to figure out the auto-detection but I agree it would be nice to have in the future. |
Retest this please. |
@masterleinad Hey just got back from vacation this week, is this ready for merging? |
I think we should wait for this until after the release to have sufficient time to test it out. |
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.
Iniital comments
@masterleinad I'm not sure I see the merit in delaying it. It doesn't change anything at all if CXX is set to nvcc_wrapper, it can be explicitly disabled, and merging it will help find edge cases much easier. |
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.
Just add comment in launch script. This all seems fine to me. Merging this sooner than later might be good. It solves nasty problems with FetchContent and ExternalProject that we've been having.
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.
I'm happy with my tests. A bit of cleanup on error messages/status messages and I'm basically ready to approve.
Curious about thoughts on changing default for the launcher script to be globally applied.
Retest this please. |
Still thinking about this. My concern now is if 2 projects import Kokkos. One of them asks for separable_compilation. The other does not. You now won't get separable compilation because the global property has been set. A counter-proposal would be this:
This PR would be a better place to add the Now we have the separable compilation problem fixed. No one needs to ask for it. If you depend on Kokkos, you go to the wrapper. If not, you're good to go. And you don't need to worry about two different Kokkos projects thrashing each other's global properties (of course, I could be misunderstanding global scope rules in find_package). |
@jjwilke I like it. What about using a compiler definition instead of a compiler flag? E.g. |
…tional behavior - Added some info in cmake about what kokkos_launch_compiler does and provides - Added ability to set Kokkos_LAUNCH_COMPILER=OFF in downstream projects - Added kokkos_compiler_is_nvcc to KokkosConfigCommon.cmake.in to avoid using kokkos_launch_compiler if CMAKE_CXX_COMPILER=nvcc_wrapper
- Fixed AND NOT AND NOT
- Created new KCL (Kokkos-Compiler-Launcher) tests
- specify CUDA arch
- Fixed environment to set CXX instead of NVCC_WRAPPER_DEFAULT_COMPILER
5d036ee
to
fe84432
Compare
The CUDA Arch detection doesn't work without a CUDA compiler. And it looks like downstream you have to set CMAKE_POLICY CMP0057 explicitly down stream? We just worked with some folks in Germany which compile some other raw CUDA as well and this made it possible relatively straight forward. Just those two things didn't work (i.e. we had to set the architecture explicitly - which I think is fine for now and can be subsequently fixed) and we had to explicitly set CMAKE_POLICY CMP0057 in the application cmake file. |
Retest this please. |
I think this was resolved since we did change the default for the launcher script to not be globally applied
Co-Authored-By: Christian Trott <crtrott@sandia.gov>
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.
I think this looks good
I moved the testing into the CUDA 11 build
Lines 184 to 245 in 6bf9c87
stage('CUDA-11.0-NVCC-C++17-RDC') { | |
agent { | |
dockerfile { | |
filename 'Dockerfile.nvcc' | |
dir 'scripts/docker' | |
additionalBuildArgs '--pull --build-arg BASE=nvidia/cuda:11.0-devel --build-arg ADDITIONAL_PACKAGES="g++-8 gfortran" --build-arg CMAKE_VERSION=3.17.3' | |
label 'nvidia-docker && volta' | |
args '-v /tmp/ccache.kokkos:/tmp/ccache' | |
} | |
} | |
environment { | |
OMP_NUM_THREADS = 8 | |
OMP_PLACES = 'threads' | |
OMP_PROC_BIND = 'spread' | |
NVCC_WRAPPER_DEFAULT_COMPILER = 'g++-8' | |
} | |
steps { | |
sh 'ccache --zero-stats' | |
sh '''rm -rf install && mkdir -p install && \ | |
rm -rf build && mkdir -p build && cd build && \ | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_CXX_COMPILER=g++-8 \ | |
-DCMAKE_CXX_FLAGS=-Werror \ | |
-DCMAKE_CXX_STANDARD=17 \ | |
-DKokkos_ENABLE_COMPILER_WARNINGS=ON \ | |
-DKokkos_ENABLE_OPENMP=ON \ | |
-DKokkos_ENABLE_CUDA=ON \ | |
-DKokkos_ENABLE_CUDA_LAMBDA=OFF \ | |
-DKokkos_ENABLE_CUDA_UVM=ON \ | |
-DKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE=ON \ | |
-DKokkos_ARCH_VOLTA70=ON \ | |
-DCMAKE_INSTALL_PREFIX=${PWD}/../install \ | |
.. && \ | |
make -j8 install && \ | |
cd .. && \ | |
rm -rf build-tests && mkdir -p build-tests && cd build-tests && \ | |
export CMAKE_PREFIX_PATH=${PWD}/../install && \ | |
cmake \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER=$WORKSPACE/bin/nvcc_wrapper \ | |
-DCMAKE_CXX_FLAGS=-Werror \ | |
-DCMAKE_CXX_STANDARD=17 \ | |
-DKokkos_INSTALL_TESTING=ON \ | |
.. && \ | |
make -j8 && ctest --output-on-failure && \ | |
cd ../example/build_cmake_installed && \ | |
rm -rf build && mkdir -p build && cd build && \ | |
cmake \ | |
-DCMAKE_CXX_COMPILER=g++-8 \ | |
-DCMAKE_CXX_FLAGS=-Werror \ | |
-DCMAKE_CXX_STANDARD=17 \ | |
.. && \ | |
make -j8 && ctest --output-on-failure''' | |
} | |
post { | |
always { | |
sh 'ccache --show-stats' | |
} | |
} | |
} |
I purposefully use
nvcc_wrapper
directly in the "install testing" step.
Proposed
kokkos_compilation
macrofind_package(Kokkos)
will invokekokkos_compilation(GLOBAL)
find_package(Kokkos COMPONENTS separable_compilation)
kokkos_compilation(GLOBAL)
and the user will be responsible for doing:kokkos_compilation(PROJECT)
kokkos_compilation(DIRECTORY <DIR>)
kokkos_compilation(TARGET <TARGETS...>)
kokkos_compilation(SOURCE <SOURCES...>)