Skip to content

Commit

Permalink
Final updates for the 0.5.0 release (#532)
Browse files Browse the repository at this point in the history
* Fix lastfm.py example for recommend
* Disable building GPU extension on windows
* Update changelog
  • Loading branch information
benfred authored Jan 28, 2022
1 parent d86c442 commit e6edd60
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
## v0.5.0

### Breaking API Changes

The API for implicit has substantially changed in v0.5.0 - and any code written for the previous
API will need to be rewritten:

* Change model.fit to take a user_items sparse matrix [#484](https://github.com/benfred/implicit/pull/484)
* Return numpy arrays from recommend methods [#482](https://github.com/benfred/implicit/pull/482)
* Don't require empty rows in user_items and item_users parameters [#526](https://github.com/benfred/implicit/pull/526)

This comment has been minimized.

Copy link
@esillen

esillen Jan 31, 2022

This can be clarified. model.recommend() api has changed and that's not really reflected in this point.

* Unify API for rank_items/recommend/recommend_all [#489](https://github.com/benfred/implicit/issues/489)

### Performance Improvements

* Speedup evaluation by using batch recommend functions [#520](https://github.com/benfred/implicit/pull/520)
* Use FAISS for GPU inference [#506](https://github.com/benfred/implicit/pull/506)
* Multithreaded speedups for CPU models [#517](https://github.com/benfred/implicit/pull/517)
* Use thrust::binary_search to verify negative samples on GPU [#524](https://github.com/benfred/implicit/pull/524)
* Release GIL on GPU calls [#528](https://github.com/benfred/implicit/pull/528)

### New Features

* Add incremental retraining support for ALS models [#527](https://github.com/benfred/implicit/pull/527)
* Add filtering for similar_items and similar_users [#488](https://github.com/benfred/implicit/issues/488)
* Add support for recalculate_users/items on the GPU [#515](https://github.com/benfred/implicit/pull/515)
* Add methods for converting MF models to/from gpu [#521](https://github.com/benfred/implicit/pull/521)
* Add a tutorial notebook for the lastfm example [#529](https://github.com/benfred/implicit/pull/529)
* Approximate nearest neighbour for BPR/LMF and GPU models [#487](https://github.com/benfred/implicit/issues/487)
* Dynamically detect CUDA availability [#174](https://github.com/benfred/implicit/issues/174)

## v0.4.5

* GPU Inference [#406](https://github.com/benfred/implicit/pull/406)
Expand Down
4 changes: 3 additions & 1 deletion examples/lastfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def calculate_recommendations(output_filename, model_name="als"):
to_generate = np.arange(len(users))
for startidx in range(0, len(to_generate), batch_size):
batch = to_generate[startidx : startidx + batch_size]
ids, scores = model.recommend(batch, user_plays, filter_already_liked_items=True)
ids, scores = model.recommend(
batch, user_plays[batch], filter_already_liked_items=True
)
for i, userid in enumerate(batch):
username = users[userid]
for other, score in zip(ids[i], scores[i]):
Expand Down
10 changes: 7 additions & 3 deletions implicit/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
add_cython_target(_cuda CXX)

if (UNIX)
find_package(CUDAToolkit)


if(CUDAToolkit_FOUND)
if (${CUDAToolkit_VERSION} VERSION_LESS "11.0.0")
message("implicit requires CUDA 11.0 or greater for GPU acceleration - found CUDA ${CUDAToolkit_VERSION}")
else()
enable_language(CUDA)
add_cython_target(_cuda CXX)

# use rapids-cmake to install dependencies
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.02/RAPIDS.cmake
Expand Down Expand Up @@ -60,6 +62,8 @@ if(CUDAToolkit_FOUND)

install(TARGETS _cuda LIBRARY DESTINATION implicit/gpu)
endif()
endif()
endif()

FILE(GLOB gpu_python_files *.py)
install(FILES ${gpu_python_files} DESTINATION implicit/gpu)

0 comments on commit e6edd60

Please sign in to comment.