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

Use thrust::binary_search to verify negative samples on GPU #524

Merged
merged 1 commit into from
Jan 21, 2022

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.

1 participant