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

Fix cuda build on conda-forge #668

Merged
merged 2 commits into from
Jun 21, 2023
Merged
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
2 changes: 1 addition & 1 deletion implicit/_nearest_neighbours.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cdef extern from "implicit/nearest_neighbours.h" namespace "implicit" nogil:


cdef class NearestNeighboursScorer(object):
""" Class to return the top K items from multipying a users likes
""" Class to return the top K items from multiplying a users likes
by a precomputed sparse similarity matrix. """
cdef SparseMatrixMultiplier[int, double] * neighbours

Expand Down
27 changes: 26 additions & 1 deletion implicit/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,42 @@ else()
add_cython_target(_cuda CXX)

# use rapids-cmake to install dependencies
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.04/RAPIDS.cmake
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.06/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cmake)
include(rapids-cpm)
include(rapids-cuda)
include(rapids-export)
include(rapids-find)
include(${rapids-cmake-dir}/cpm/package_override.cmake)

rapids_cpm_init()
rapids_cmake_build_type(Release)

# thrust/cub have a cmake issue where the conda build fails
# to find them, and needs these patches
# https://github.com/benfred/cub/commit/97934d146b771fd2e8bda75f73349a4b3c9e10a7
# https://github.com/benfred/thrust/commit/8452c764cc8d772314169e99811535f3a9108cfe
# (note that cub is pulled in through thrust here - meaning we only need to override
# the thrust version to pull it in)
# Issue is tracked in https://github.com/NVIDIA/thrust/issues/1966
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
[=[
{
"packages" : {
"Thrust" : {
"version" : "1.17.2",
"git_url" : "https://github.com/benfred/thrust.git",
"git_tag" : "no_cmake_find_root_path",
"git_shallow" : true,
"always_download" : true,
}
}
}
]=])
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json)

# get rmm
include(${rapids-cmake-dir}/cpm/rmm.cmake)
rapids_cpm_rmm(BUILD_EXPORT_SET implicit-exports INSTALL_EXPORT_SET implicit-exports)
Expand Down