-
Notifications
You must be signed in to change notification settings - Fork 757
Enable multiconfig builds for testing / validation #1159
Comments
The cross product I used to test with Jenkins was {cpp, omp, tbb} X {cuda, omp, tbb} I don't know how useful it is to test e.g. host=tbb, device=tbb, but it's a possible configuration, so there must be some users out there doing that. |
Ok, I'll start with that full cross product and see how expensive it is to build. If it's too much, we can split the configs up into a full set (for CI) and a "common" set for quick (well, for some definition of 'quick') local testing. |
SGTM I'm not familiar with the current state of Thrust's build, but I'd say the most valuable things we could do would be something like this:
|
I've updated the "Configurations" section of the issue with something that I think will work for most cases. re: the current state of things, by default we just build and test CPP/CUDA. We can change the host and/or device for the entire build by reconfiguring with CMake. After this change, that will still be the default behavior. This is most useful for feature development and iterative changes targeted at a single backend. Turning on |
If we do this, we should probably do this for all the other variants, which I believe is:
e.g. Maybe we should do at least C++ dialect in this PR. |
Updated proposal with C++ dialect options for C++11, 14, and 17. It defaults to just C++17 since I figure that'll give the most coverage. |
Updated names to be less harsh and more useful for categorizing targets:
|
Here are some of my findings from testing out multiconfig builds this weekend. Hardware specs and raw data are in this gist. This is on my NVIDIA provided workstation, so these numbers should be similar (or better) for the other members of the NVIDIA developer team. There is currently an issue preventing the MultiConfig Cost SummaryThe key takeaways are:
The workload grouping has been updated to reflect this:
The
Cost of increasing workloadTo determine which workload to build, it's useful to know the cost of increasing to the next largest workload. This section tabulates the time needed to build only the new configurations in each workload.
Total build time per workloadTo estimate the amount of time needed for a given workload / dialect combination, this section compares the full build times.
DetailsCPUs backends are super cheapEach build that doesn't require CUDA takes 1-4 minutes. Using the host==device configs to compare their build times, the trend here is about what you'd expect:
The full cross product of the CPU backends -- including the unlikely/silly combos -- only takes about 25 minutes to compile for a single cpp dialect. Most of the time is spent building CUDA configsAll configurations that use the CUDA backend take a full hour to build when all SM versions are enabled (except 5.3, 6.2, and 7.2, which don't build with RDC). Most of this is due to toolchain overhead in nvcc, but there's also more CUDA code to compile. A non-CUDA build has ~515 targets, but CUDA has ~895. Some CUDA targets are very expensiveThere are a few monster translation units that take a very long time on CUDA. The most expensive targets in the
and quite a few others in the 6-10 minute range. A timeline of the |
Did some additional tests varying the number of target SMs on
I've switched to just building the 2 SMs I can test locally, and this changes the total build time to for |
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake requirement to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake requirement to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake requirement to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: Disable arches 53, 62, 72 by default. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP and TBB tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING - THRUST_ENABLE_EXAMPLE_FILECHECK Summary: - Bump CMake requirement to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Removed common_variables.cmake and simplified FileCheck hooks. - Set THRUST_ENABLE_EXAMPLE_FILECHECK to turn on FileCheck validation - Automatically detect and set THRUST_FILECHECK_EXECUTABLE if installed and filechecking is enabled. - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes NVIDIA#1159. Also fixes or works around these issues: - WAR NVIDIA#1167: - Disable arches 53, 62, 72 for RDC-required tests, print warning - Error when ENABLE_RDC for tests/examples is set with a no-RDC arch. - Fixes NVIDIA#1168: Set RUN_SERIAL on OpenMP and TBB tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR NVIDIA#1174: remove warning promotion from tbb.cuda targets. - WAR NVIDIA#976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake requirement to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Fixes #1159. Also fixes or works around these issues: - WAR #1167: - Disable arches 53, 62, 72 for RDC-required tests, print warning - Error when ENABLE_RDC for tests/examples is set with a no-RDC arch. - Fixes #1168: Set RUN_SERIAL on OpenMP and TBB tests. - WAR ccache/ccache#598: nvcc flags `s/-Werror all-warnings/-Xcudafe --promote_warnings/g` - WAR #1174: remove warning promotion from tbb.cuda targets. - WAR #976: Add options to enable/disable tests, examples, header_tests: - THRUST_ENABLE_TESTING - THRUST_ENABLE_EXAMPLES - THRUST_ENABLE_HEADER_TESTING Summary: - Bump CMake requirement to 3.15 - Needed for CUDA_COMPILER_ID generator expression. - Removed workarounds for older CMake versions. - Removed warning flag specific to for C++98. - Dialects are now configured through target properties. Add new THRUST_CPP_DIALECT option for single config mode, and remove logic that modified CMAKE_CXX_STANDARD and CMAKE_CUDA_STANDARD. - Move testing related CMake code to `testing/CMakeLists.txt` - Move example related CMake code to `examples/CMakeLists.txt` - Move header testing related CMake code to `cmake/ThrustHeaderTesting.cmake` - Move CUDA configuration logic to `cmake/ThrustCUDAConfig.cmake`. - Explicitly `include(cmake/*.cmake)` files rather than searching CMAKE_MODULE_PATH -- we only want to use the ones in the repo. - Added ThrustMultiConfig.cmake - Handle MultiConfig (and single config) logic. - Added ThrustBuildTargetList.cmake - Builds the THRUST_TARGETS list, which contains one interface target for each enabled host/device/dialect configuration. - Added ThrustBuildCompilerTargets.cmake - Move warning flag, etc setup into it, bind compile interfaces to targets instead of global variables. - Renamed common_variables.cmake to ThrustCommonVariables.cmake - Removed THRUST_TREAT_FILE_AS_CXX - This worked by setting a cmake SOURCE_FILE property, which no longer works since multiconfig may build the same source file with both CXX and CUDA. - Instead, the `.cu` files are wrapped in a `.cpp` file that does nothing but include the `.cu` file. The `.cpp` files are then added to the CXX targets as sources. - See `cmake/ThrustUtilities.cmake` for implementation. - Fix bug in thrust-config.cmake where an internal var was not cached as expected.
Problem
Currently, a Thrust build must be reconfigured and rebuilt to test and validate various host/device system combinations. This quickly gets tedious when testing whether a change will break any of the backends.
Being an NVIDIA product, the core Thrust developers tend to focus on the
HOST=CPP DEVICE=CUDA
configuration, and bugs sometimes slip into the other backends that go unnoticed until a user reports them.By simplifying the process of testing other configurations, we can provide a more stable and reliable product to users that rely on the OpenMP and TBB backends. This will also be useful as our CI improves, as we can have a single CI build generate multiple configurations.
Overview
I propose adding a
THRUST_ENABLE_MULTICONFIG
cmake option. By default, this will be off and everything will work as it does now. But when enabled, this will:THRUST_HOST_SYSTEM
/THRUST_DEVICE_SYSTEM
cache options.THRUST_MULTICONFIG_WORKLOAD
option with settingsFULL
,LARGE
,MEDIUM
,SMALL
(DefaultMEDIUM
).THRUST_MULTICONFIG_ENABLE_${system}
boolean options (DefaultON
).THRUST_MULTICONFIG_ENABLE_CPPXX
boolean options for C++11, C++14, and C++17. Default is just C++14.Configurations
The
THRUST_MULTICONFIG_ENABLE_${system}
options are used to specify the expected systems that a particular build should use. Dependencies of disabled systems will not be searched for, and any configurations that use a disabled system will not be tested. If a system is requested but an associated dependency is not found, a configuration error will occur.The
THRUST_MULTICONFIG_ENABLE_CPP11
,THRUST_MULTICONFIG_ENABLE_CPP14
, andTHRUST_MULTICONFIG_ENABLE_CPP17
options will produce configurations for each of the indicated C++ dialects. By default, only C++14 is enabled.The
THRUST_MULTICONFIG_WORKLOAD
option controls how much of the configuration space is tested. The full cross product ofHOST={CPP, TBB, OMP}
andDEVICE={CUDA, TBB, OMP, CPP}
is quite expensive to build, so the workload may be adapted to suite available resources.The full configuration space is divided into groups that maximize coverage while eliminating redundant or unusual configurations and minimizing expense. This provides a convenient way to balance the amount of coverage needed for a particular usecase (local pre-CI testing, CI, pre-release testing, etc) with the amount of computational resources.
SMALL
: [3 configs] Minimal coverage and validation of each device system against theCPP
host.MEDIUM
: [6 configs] Cheap extended coverage.LARGE
: [8 configs] Expensive extended coverage. Include all useful build configurations.FULL
: [12 configs] The complete cross product of all possible build configurations.FULL
LARGE
MEDIUM
SMALL
Target Naming
The test/example names will need to be modified to reflect which configuration the executable belongs to. For instance:
For non-multiconfig builds, the names will stay the same as they currently are.
Meta-targets
Custom CMake targets will be added to make it easier to build subsets of a single configuration.
thrust.<host>.<device>.<dialect>.all
thrust.<host>.<device>.<dialect>.headers
thrust.<host>.<device>.<dialect>.tests
thrust.<host>.<device>.<dialect>.examples
Testing
Tests can be filtered by configuration by using
-R <regex>
when invoking CTest, e.g.:Build Time Considerations
A detailed exploration of the compile time requirements of each configuration is in this comment. An overview of the relative build times for each workload and dialect is shown below.
The text was updated successfully, but these errors were encountered: