Skip to content

Commit

Permalink
Fix Implicit ALS matrix zero assignment size on GPU (#228)
Browse files Browse the repository at this point in the history
Fixed ValueError for `ImplicitALSWrapperModel` with GPU
  • Loading branch information
chezou authored Dec 11, 2024
1 parent 75a30c1 commit eabfad1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support `fit_partial()` for LightFM ([#223](https://github.com/MobileTeleSystems/RecTools/pull/223))
- LightFM Python 3.12+ support ([#224](https://github.com/MobileTeleSystems/RecTools/pull/224))

### Fixed
- Fix Implicit ALS matrix zero assignment size ([#228](https://github.com/MobileTeleSystems/RecTools/pull/228))

### Removed
- Python 3.8 support ([#222](https://github.com/MobileTeleSystems/RecTools/pull/222))

Expand Down
4 changes: 2 additions & 2 deletions rectools/models/implicit_als.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ def _fit_combined_factors_on_gpu_inplace(
model._item_norms_host = model._user_norms_host = None # pylint: disable=protected-access
model._YtY = model._XtX = None # pylint: disable=protected-access

_YtY = implicit.gpu.Matrix.zeros(model.factors, model.factors)
_XtX = implicit.gpu.Matrix.zeros(model.factors, model.factors)
_YtY = implicit.gpu.Matrix.zeros(*item_factors.shape)
_XtX = implicit.gpu.Matrix.zeros(*user_factors.shape)

for _ in tqdm(range(iterations), disable=verbose == 0):

Expand Down

0 comments on commit eabfad1

Please sign in to comment.