diff --git a/CHANGELOG.md b/CHANGELOG.md index 28d0cc32..3f56aff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) +* 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) diff --git a/examples/lastfm.py b/examples/lastfm.py index 7b951837..32b5f888 100644 --- a/examples/lastfm.py +++ b/examples/lastfm.py @@ -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]): diff --git a/implicit/gpu/CMakeLists.txt b/implicit/gpu/CMakeLists.txt index 8f948a57..7c278614 100644 --- a/implicit/gpu/CMakeLists.txt +++ b/implicit/gpu/CMakeLists.txt @@ -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 @@ -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)