Skip to content

Commit

Permalink
Merge branch 'fix_build_error_cudf' into 'main'
Browse files Browse the repository at this point in the history
Fix build error cudf in mlperf

See merge request dl/hugectr/hugectr!1450
  • Loading branch information
minseokl committed Aug 31, 2023
2 parents 6def179 + 203aa28 commit ef4f0e2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tools/dlrm_script/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ include_directories(${CONDA_PREFIX}/include/libcudf/libcudacxx)

link_directories(${CONDA_PREFIX}/lib)

# Check cudf version
execute_process(COMMAND bash -c "pip show cudf|grep Version | sed 's/.*: //'" OUTPUT_VARIABLE CUDF_VERSION)
message(STATUS "CUDF_VERSION = ${CUDF_VERSION}")

string(COMPARE EQUAL "${CUDF_VERSION}" "" CUDF_RESULT)
if (NOT CUDF_RESULT)
string(REPLACE "." ";" CUDF_VERSION_LIST ${CUDF_VERSION})
list(GET CUDF_VERSION_LIST 0 CUDF_VERSION_MAJOR)
list(GET CUDF_VERSION_LIST 1 CUDF_VERSION_MINOR)
list(GET CUDF_VERSION_LIST 1 CUDF_VERSION_PATCH)

if(${CUDF_VERSION_MAJOR} EQUAL 23 AND ${CUDF_VERSION_MINOR} GREATER 6)
add_definitions(-DCUDF_GE_2306)
endif()
else()
message(FATAL_ERROR "Can not detect cudf in your environment! ")
endif()

add_executable(dlrm_raw ${dlrm_raw_src})

target_link_libraries(dlrm_raw PUBLIC hugectr_core23)
Expand Down
12 changes: 12 additions & 0 deletions tools/dlrm_script/hash/concurrent_unordered_map.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
#include <cassert>
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/detail/utilities/device_atomics.cuh>
#ifndef CUDF_GE_2306
#include <cudf/detail/utilities/hash_functions.cuh>
#else
#include <cudf/hashing/detail/default_hash.cuh>
#endif
#include <cudf/utilities/error.hpp>
#include <hash/hash_allocator.cuh>
#include <hash/helper_functions.cuh>
Expand All @@ -33,8 +37,16 @@
// cudf 22.06 moved the namespace of default_hash to cudf::detail
// and renamed CUDA_TRY to CUDF_CUDA_TRY. Handle both of these
// so that we can compile against both cudf 22.04 and cudf 22.06+
// CUDF_GE_2306: from cudf 23.08 moves the new file and the `hash_functions.cuh`
// from `cpp/include/cudf/detail/utilities/` to `cpp/include/cudf/hashing/detail`
// The hash functions were redeclared from the `cudf::detail` namespace
// to the `cudf::hashing::detail` namespace
#ifdef CUDF_CUDA_TRY
#ifndef CUDF_GE_2306
using cudf::detail::default_hash;
#else
using cudf::hashing::detail::default_hash;
#endif
#define CUDA_TRY CUDF_CUDA_TRY
#endif

Expand Down

0 comments on commit ef4f0e2

Please sign in to comment.