Multi-GPU support for `FaissIndex`
{'login': 'rentruewang', 'id': 32859905, 'node_id': 'MDQ6VXNlcjMyODU5OTA1', 'avatar_url': 'https://avatars.githubusercontent.com/u/32859905?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/rentruewang', 'html_url': 'https://github.com/rentruewang', 'followers_url': 'https://api.github.com/users/rentruewang/followers', 'following_url': 'https://api.github.com/users/rentruewang/following{/other_user}', 'gists_url': 'https://api.github.com/users/rentruewang/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/rentruewang/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/rentruewang/subscriptions', 'organizations_url': 'https://api.github.com/users/rentruewang/orgs', 'repos_url': 'https://api.github.com/users/rentruewang/repos', 'events_url': 'https://api.github.com/users/rentruewang/events{/privacy}', 'received_events_url': 'https://api.github.com/users/rentruewang/received_events', 'type': 'User', 'site_admin': False}
[]
[]
Any love? Hi, any update? @albertvillanova Sorry for bothering you again, quick follow up: is there anything else you want me to add / modify? Hi @rentruewang , we updated the documentation on `master`, could you merge `master` into your branch please ? @lhoestq I've merge `huggingface/datasets/master` into this PR. Please review. Thanks! 🤗

Edit: Umm... I was experimenting with what renaming a branch would do to a pull request. Please ignore the `closed this PR` down below. 🤗
Per #3716 , current implementation does not take into consideration that `faiss` can run on multiple GPUs.

In this commit, I provided multi-GPU support for `FaissIndex` by modifying the device management in `IndexableMixin.add_faiss_index` and `FaissIndex.load`.

Now users are able to pass in
1. a positive integer (as usual) to use 1 GPU
2. a negative integer `-1` to use all GPUs
3. a list of integers e.g. `[0, 1]` to run only on those GPUs
4. Of course, passing in nothing still runs on CPU.

This closes: #3716 
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3721/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/3721', 'html_url': 'https://github.com/huggingface/datasets/pull/3721', 'diff_url': 'https://github.com/huggingface/datasets/pull/3721.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/3721.patch', 'merged_at': '2022-03-07T16:28:56Z'}