Skip to content

Conversation

@benfred
Copy link
Owner

@benfred benfred commented Jan 21, 2022

Use thrust::binary_search to verify negative samples on the GPU instead of
doing a linear scan in the BPR model.

This leads to a noticeable perf increase on larger datasets. For instance on the
Github stars dataset:
* Using linear_search: 3.09s/it
* using thrust::binary_search 1.53s/it
* w/ verify_negative_samples=False 1.18s/it

This change doubles the BPR training performance on that dataset, and also
leads to times that are only 30% slower than not verifying samples at all.

Use thrust::binary_search to verify negative samples on the GPU instead of
doing a linear scan in the BPR model.

This leads to a noticeable perf increase on larger datasets. For instance on the
Github stars dataset:
    * Using linear_search: 3.09s/it
    * using thrust::binary_search 1.53s/it
    * w/ verify_negative_samples=False  1.18s/it

This change doubles the BPR training performance on that dataset, and also
leads to times that are only 30% slower than not verifying samples at all.
@benfred benfred merged commit 07bfd8f into main Jan 21, 2022
@benfred benfred deleted the gpu_bpr_binary_search branch January 22, 2022 01:26
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