benfred / implicit

Fast Python Collaborative Filtering for Implicit Feedback Datasets
https://benfred.github.io/implicit/
MIT License
3.57k stars 612 forks source link

Shoot up in model training time for implicit.bpr (10x) #686

Closed SaifJawaid closed 1 year ago

SaifJawaid commented 1 year ago

I have been using this version of the library implicit==0.4.4, but since last month the training time for my data has shot up 10x. Was there any specific change in your code which caused this? What troubleshooting solution do you recommend?

benfred commented 1 year ago

One possible problem was a performance regression introduced by Cython 3.0, which was causing over 10x slowdowns on training https://github.com/benfred/implicit/issues/678 . If you were building implicit from source, and were using Cython 3.0 (released on July 17th) - this is likely to be the issue you were facing.

This should be fixed in the latest version (v0.7.1) that was released last week. If you haven't already, can you see if this fixes the performance issue?

benfred commented 1 year ago

Also - note that there were some breaking API changes in implicit v0.5.0 https://github.com/benfred/implicit/issues/481, that you should be aware of if you're updating to the latest version

SaifJawaid commented 1 year ago

@benfred changing the version of Cython to a previous version worked for me (v0.29.35). Thank you