Skip to content

Gpu inference#406

Merged
benfred merged 8 commits into
masterfrom
gpu_inference
Sep 30, 2020
Merged

Gpu inference#406
benfred merged 8 commits into
masterfrom
gpu_inference

Conversation

@benfred

@benfred benfred commented Sep 30, 2020

Copy link
Copy Markdown
Owner

Add gpu methods for recommend/rank_items/similar_items, by using cupy arrays
to store the factors and do the inference computations. This change also
splits the cpu/gpu code bases entirely - so the existing numpy code won't
work on the gpu factors.

The ALS model was spinning for ever when trying to train with more than
2^31 interactions. This was caused by using 32 bit ints in the cython
code which overflowed. Fix.
Add gpu methods for recommend/rank_items/similar_items, by using cupy arrays
to store the factors and do the inference computations. This change also
splits the cpu/gpu code bases entirely - so the existing numpy code won't
work on the gpu factors.
Add gpu methods for recommend/rank_items/similar_items, by using cupy arrays
to store the factors and do the inference computations. This change also
splits the cpu/gpu code bases entirely - so the existing numpy code won't
work on the gpu factors.
@benfred benfred merged commit 1932223 into master Sep 30, 2020
@benfred benfred deleted the gpu_inference branch September 30, 2020 18:09
@benfred benfred mentioned this pull request Sep 30, 2020
@tRosenflanz

tRosenflanz commented Sep 30, 2020

Copy link
Copy Markdown

This adds cupy as a dependency for GPU runs. However, it has to be installed separately to avoid blocking CPU users or do a CUDA conditional install

@benfred

benfred commented Sep 9, 2021

Copy link
Copy Markdown
Owner Author

@tRosenflanz - I've removed the cupy dependency here #458 , and have accelerated the inference code further in #460.

GPU inference is currently 40x faster on my system for querying a single user at a time. Getting better times than this will require batch inference on the GPU - which I will get to in a future release.

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

Successfully merging this pull request may close these issues.

2 participants