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

Fix train/predict bugs in PairwiseANN #271

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

OctoberChang
Copy link
Contributor

Issue #, if available:

Description of changes:
Fix train/predict bugs in PairwiseANN:
(1) For training, deep copy the X_trn and Y_csc matrix, to prevent pX/pY being modified and deleted at Python level. Otherwise, the PairwiseANN index may save the wrong content, or facing sagmentation fault.
(2) For inference, searchers take in the pred_params, which pre-allocate the memory of return numpy array. We do not accept different topk at PairwiseANN.predict(), as it cause complexity to slice the returned matrix back.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@OctoberChang OctoberChang merged commit e4c824d into amzn:mainline Dec 7, 2023
25 checks passed
@OctoberChang OctoberChang deleted the pairwise-ann branch January 2, 2024 21:42
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