Skip to content

Commit e6edd60

Browse files
authored
Final updates for the 0.5.0 release (#532)
* Fix lastfm.py example for recommend * Disable building GPU extension on windows * Update changelog
1 parent d86c442 commit e6edd60

3 files changed

Lines changed: 40 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
## v0.5.0
2+
3+
### Breaking API Changes
4+
5+
The API for implicit has substantially changed in v0.5.0 - and any code written for the previous
6+
API will need to be rewritten:
7+
8+
* Change model.fit to take a user_items sparse matrix [#484](https://github.com/benfred/implicit/pull/484)
9+
* Return numpy arrays from recommend methods [#482](https://github.com/benfred/implicit/pull/482)
10+
* Don't require empty rows in user_items and item_users parameters [#526](https://github.com/benfred/implicit/pull/526)
11+
* Unify API for rank_items/recommend/recommend_all [#489](https://github.com/benfred/implicit/issues/489)
12+
13+
### Performance Improvements
14+
15+
* Speedup evaluation by using batch recommend functions [#520](https://github.com/benfred/implicit/pull/520)
16+
* Use FAISS for GPU inference [#506](https://github.com/benfred/implicit/pull/506)
17+
* Multithreaded speedups for CPU models [#517](https://github.com/benfred/implicit/pull/517)
18+
* Use thrust::binary_search to verify negative samples on GPU [#524](https://github.com/benfred/implicit/pull/524)
19+
* Release GIL on GPU calls [#528](https://github.com/benfred/implicit/pull/528)
20+
21+
### New Features
22+
23+
* Add incremental retraining support for ALS models [#527](https://github.com/benfred/implicit/pull/527)
24+
* Add filtering for similar_items and similar_users [#488](https://github.com/benfred/implicit/issues/488)
25+
* Add support for recalculate_users/items on the GPU [#515](https://github.com/benfred/implicit/pull/515)
26+
* Add methods for converting MF models to/from gpu [#521](https://github.com/benfred/implicit/pull/521)
27+
* Add a tutorial notebook for the lastfm example [#529](https://github.com/benfred/implicit/pull/529)
28+
* Approximate nearest neighbour for BPR/LMF and GPU models [#487](https://github.com/benfred/implicit/issues/487)
29+
* Dynamically detect CUDA availability [#174](https://github.com/benfred/implicit/issues/174)
30+
131
## v0.4.5
232

333
* GPU Inference [#406](https://github.com/benfred/implicit/pull/406)

examples/lastfm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def calculate_recommendations(output_filename, model_name="als"):
151151
to_generate = np.arange(len(users))
152152
for startidx in range(0, len(to_generate), batch_size):
153153
batch = to_generate[startidx : startidx + batch_size]
154-
ids, scores = model.recommend(batch, user_plays, filter_already_liked_items=True)
154+
ids, scores = model.recommend(
155+
batch, user_plays[batch], filter_already_liked_items=True
156+
)
155157
for i, userid in enumerate(batch):
156158
username = users[userid]
157159
for other, score in zip(ids[i], scores[i]):

implicit/gpu/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
add_cython_target(_cuda CXX)
2-
1+
if (UNIX)
32
find_package(CUDAToolkit)
43

5-
64
if(CUDAToolkit_FOUND)
5+
if (${CUDAToolkit_VERSION} VERSION_LESS "11.0.0")
6+
message("implicit requires CUDA 11.0 or greater for GPU acceleration - found CUDA ${CUDAToolkit_VERSION}")
7+
else()
78
enable_language(CUDA)
9+
add_cython_target(_cuda CXX)
810

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

6163
install(TARGETS _cuda LIBRARY DESTINATION implicit/gpu)
6264
endif()
65+
endif()
66+
endif()
6367

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

0 commit comments

Comments
 (0)