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

[BUG] Model fitting time increases significantly starting from version 1.16.0 #557

Closed
romqn1999 opened this issue Dec 5, 2023 · 3 comments

Comments

@romqn1999
Copy link

Description

I am utilizing the BPR model for my recommender system.

I have experimented with the same class BPR across different versions while training the models on identical datasets. The results showed that:

  • Using the library version <=1.15.4, the process rate is approximately 3it/s
  • With the library version >=1.16.0, the process rate is around 100s/it

In which platform does it happen?

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

How do we replicate the issue?

My script runs in a venv with python3.9

from cornac.data import Dataset
from cornac.models import BPR


train_set = Dataset.from_uir(...)

model = BPR(k=128, max_iter=500, learning_rate=0.05, lambda_reg=0.001, verbose=True)

model.fit(train_set)

Expected behavior

The fitting time for the same model in the later versions should not be longer than the fitting time in the earlier versions.

@tqtg
Copy link
Member

tqtg commented Dec 5, 2023

Thanks for raising this. We've identified the issue that it's due to behavior changes of Cython in the recent migration. We're working on a fix (#558).

Please rest assured that there shouldn't any changes in the performance of BPR model in version 1.15.4 as compared to the latest. You can safely use that version until we incorporate the fix into our next release. In case you want to use certain features only available from version 1.16, you can pull the #558 and install Cornac from source.

Let us know if this resolves your issue. Thanks.

@romqn1999
Copy link
Author

Thank you for your prompt reply. I'm considering using the BPR model in version 1.15.4 for now.

@tqtg
Copy link
Member

tqtg commented Dec 12, 2023

The fix is now released in v1.18. Closing this issue.

@tqtg tqtg closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants