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

add test to cover GPU #4130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add test to cover GPU #4130

wants to merge 2 commits into from

Conversation

junjieqi
Copy link
Contributor

Summary: same as title

Differential Revision: D68388863

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68388863

Di-Is and others added 2 commits January 19, 2025 00:49
Summary:
This pull request introduces a new default argument, `ngpu=-1`, to the `knn_ground_truth` function in the `faiss.contrib`.

## Purpose of Change

### Bug Fix

In the current implementation, running tests under the tests directory (CPU tests) in an environment with faiss-gpu installed would inadvertently use the GPU and cause unintended behavior.
This pull request prevents the GPU from being used during CPU-only tests by explicitly controlling GPU allocation via the ngpu parameter.

### API Consistency

Other functions that call `faiss.get_num_gpus` in `faiss.contrib`, such as `range_search_max_results` and `range_ground_truth`, already include the `ngpu` argument.
Adding this parameter to `knn_ground_truth` will ensure consistency across the API, reduce potential confusion, and improve ease of use.


Differential Revision: D68199506

Pulled By: junjieqi
Summary:

same as title

Differential Revision: D68388863
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68388863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants