Skip to content
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

jitify 2 support #7372

Merged
merged 44 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
820e9e0
.
cwharris Mar 23, 2021
583f159
.
cwharris Mar 23, 2021
75a502e
.
cwharris Mar 23, 2021
9195669
.
cwharris Mar 24, 2021
f5ad342
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Mar 24, 2021
f95a35c
.
cwharris Mar 26, 2021
33aea5d
.
cwharris Mar 27, 2021
e743dfd
.
cwharris Mar 27, 2021
08861f3
.
cwharris Mar 29, 2021
d24185f
.
cwharris Mar 29, 2021
39ef4b7
.
cwharris Mar 29, 2021
d2787c7
.
cwharris Mar 29, 2021
afb1701
.
cwharris Mar 29, 2021
bcbee55
.
cwharris Mar 29, 2021
f126c18
.
cwharris Mar 30, 2021
ac08ed2
.
cwharris Mar 30, 2021
f7b0283
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Mar 30, 2021
c34df1a
.
cwharris Mar 31, 2021
dbec6b0
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Mar 31, 2021
511f222
.
cwharris Mar 31, 2021
84a9234
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Mar 31, 2021
0f76ef2
.
cwharris Mar 31, 2021
6b6b77a
.
cwharris Mar 31, 2021
999f435
.
cwharris Mar 31, 2021
0d0d874
.
cwharris Mar 31, 2021
2e0f9c2
.
cwharris Mar 31, 2021
80eb30c
.
cwharris Mar 31, 2021
557f412
.
cwharris Apr 1, 2021
ee452b1
re-add jitify2 cache dir config func, but dont enable caching yet bec…
cwharris Apr 1, 2021
db788c1
address pr comment minor changes
cwharris Apr 1, 2021
e0b9ccd
jitify preprocesss cmake file improvements
cwharris Apr 1, 2021
ecfc2bf
copyright date changes, removed unnecessary import, rearranged some i…
cwharris Apr 1, 2021
bb92585
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Apr 1, 2021
21eb7b2
fix imports after import rearrange in dependant file
cwharris Apr 1, 2021
f595fd9
jitify2 disk cache support
cwharris Apr 1, 2021
3f861a1
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Apr 1, 2021
e516759
fix binary ops operation-udf.hpp includes
cwharris Apr 1, 2021
a92aa37
get rid of auto static global variables in headers that I never shoul…
cwharris Apr 1, 2021
8a113fa
uncomment double-commented header comment
cwharris Apr 1, 2021
31a922c
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Apr 1, 2021
4451aa7
add unordered lookup of ProgramCache to support lazy instantiation of…
cwharris Apr 2, 2021
998c86e
add second search for program cache after guard for thread safety
cwharris Apr 2, 2021
e71dbc1
Merge branch 'branch-0.19' of github.com:rapidsai/cudf into jitify2
cwharris Apr 2, 2021
b8580e2
fix race condition where iterator can be invalidated before dereferen…
cwharris Apr 2, 2021
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
17 changes: 5 additions & 12 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ include(cmake/thirdparty/CUDF_GetDLPack.cmake)
include(cmake/thirdparty/CUDF_GetLibcudacxx.cmake)
# find or install GoogleTest
include(cmake/thirdparty/CUDF_GetGTest.cmake)
# Stringify libcudf and libcudacxx headers used in JIT operations
include(cmake/Modules/StringifyJITHeaders.cmake)
# preprocess jitify-able kernels
include(cmake/Modules/JitifyPreprocessKernels.cmake)
# find cuFile
include(cmake/Modules/FindcuFile.cmake)

Expand All @@ -153,9 +153,6 @@ add_library(cudf
src/ast/transform.cu
src/binaryop/binaryop.cpp
src/binaryop/compiled/binary_ops.cu
src/binaryop/jit/code/kernel.cpp
src/binaryop/jit/code/operation.cpp
src/binaryop/jit/code/traits.cpp
src/labeling/label_bins.cu
src/bitmask/null_mask.cu
src/column/column.cu
Expand Down Expand Up @@ -256,7 +253,6 @@ add_library(cudf
src/io/utilities/parsing_utils.cu
src/io/utilities/type_conversion.cpp
src/jit/cache.cpp
src/jit/launcher.cpp
src/jit/parser.cpp
src/jit/type.cpp
src/join/cross_join.cu
Expand Down Expand Up @@ -302,8 +298,6 @@ add_library(cudf
src/reshape/interleave_columns.cu
src/reshape/tile.cu
src/rolling/grouped_rolling.cu
src/rolling/jit/code/kernel.cpp
src/rolling/jit/code/operation.cpp
src/rolling/rolling.cu
src/round/round.cu
src/scalar/scalar.cpp
Expand Down Expand Up @@ -387,7 +381,6 @@ add_library(cudf
src/text/tokenize.cu
src/transform/bools_to_mask.cu
src/transform/encode.cu
src/transform/jit/code/kernel.cpp
src/transform/mask_to_bools.cu
src/transform/nans_to_nulls.cu
src/transform/row_bit_count.cu
Expand Down Expand Up @@ -465,7 +458,7 @@ endif()
target_compile_definitions(cudf PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")

# Compile stringified JIT sources first
add_dependencies(cudf stringify_run)
add_dependencies(cudf jitify_preprocess_run)

# Specify the target module library dependencies
target_link_libraries(cudf
Expand All @@ -476,9 +469,9 @@ target_link_libraries(cudf
rmm::rmm)

if(CUDA_STATIC_RUNTIME)
target_link_libraries(cudf PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::cuda_driver)
target_link_libraries(cudf PUBLIC CUDA::cudart_static CUDA::cuda_driver)
else()
target_link_libraries(cudf PUBLIC CUDA::nvrtc CUDA::cudart CUDA::cuda_driver)
target_link_libraries(cudf PUBLIC CUDA::cudart CUDA::cuda_driver)
endif()

# Add cuFile interface if available
Expand Down
70 changes: 70 additions & 0 deletions cpp/cmake/Modules/JitifyPreprocessKernels.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================

cmake_minimum_required(VERSION 3.18)

file(MAKE_DIRECTORY "${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files")

# Create `jitify_preprocess` executable
project(jitify_preprocess VERSION 2.0 LANGUAGES CXX CUDA)
add_executable(jitify_preprocess "${JITIFY_INCLUDE_DIR}/jitify2_preprocess.cpp")

target_link_libraries(jitify_preprocess CUDA::cudart ${CMAKE_DL_LIBS})

function(jit_preprocess_files)
cmake_parse_arguments(ARG
""
"SOURCE_DIRECTORY"
"FILES"
${ARGN}
)

foreach(ARG_FILE ${ARG_FILES})
set(ARG_OUTPUT ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files/${ARG_FILE}.jit)
list(APPEND JIT_PREPROCESSED_FILES "${ARG_OUTPUT}")
add_custom_command(WORKING_DIRECTORY ${ARG_SOURCE_DIRECTORY}
DEPENDS jitify_preprocess
OUTPUT ${ARG_OUTPUT}
VERBATIM
COMMAND jitify_preprocess ${ARG_FILE}
-o ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files
-v
-i
-m
-std=c++14
-remove-unused-globals
-D__CUDACC_RTC__
-I${CUDF_SOURCE_DIR}/include
-I${CUDF_SOURCE_DIR}/src
-I${LIBCUDACXX_INCLUDE_DIR}
-I${CUDAToolkit_INCLUDE_DIRS}
--no-preinclude-workarounds
--no-replace-pragma-once
)
endforeach()
set(JIT_PREPROCESSED_FILES "${JIT_PREPROCESSED_FILES}" PARENT_SCOPE)
endfunction()

jit_preprocess_files(SOURCE_DIRECTORY ${CUDF_SOURCE_DIR}/src
FILES binaryop/jit/kernel.cu
transform/jit/kernel.cu
rolling/jit/kernel.cu
)

add_custom_target(jitify_preprocess_run DEPENDS ${JIT_PREPROCESSED_FILES})

file(COPY "${LIBCUDACXX_INCLUDE_DIR}/" DESTINATION "${CUDF_GENERATED_INCLUDE_DIR}/include/libcudacxx")
file(COPY "${LIBCXX_INCLUDE_DIR}" DESTINATION "${CUDF_GENERATED_INCLUDE_DIR}/include/libcxx")
Loading