scann


Namescann JSON
Version 1.3.2 PyPI version JSON
download
home_pagehttps://github.com/google-research/google-research/tree/master/scann
SummaryScalable Nearest Neighbor search library
upload_time2024-05-07 18:07:02
maintainerNone
docs_urlNone
authorGoogle Inc.
requires_pythonNone
licenseApache 2.0
keywords machine learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# ScaNN

ScaNN (Scalable Nearest Neighbors) is a method for efficient vector similarity
search at scale. This code release implements [1], which includes search space
pruning and quantization for Maximum Inner Product Search and also supports
other distance functions such as Euclidean distance. The implementation is
designed for x86 processors with AVX2 support. ScaNN achieves state-of-the-art
performance on [ann-benchmarks.com](http://ann-benchmarks.com) as shown on the
glove-100-angular dataset below:

![glove-100-angular](https://github.com/google-research/google-research/raw/master/scann/docs/glove_bench.png)

ScaNN can be configured to fit datasets with different sizes and distributions.
It has both TensorFlow and Python APIs. The library shows strong performance
with large datasets [1]. The code is released for research purposes. For more
details on the academic description of algorithms, please see [1].

Reference [1]:
```
@inproceedings{avq_2020,
  title={Accelerating Large-Scale Inference with Anisotropic Vector Quantization},
  author={Guo, Ruiqi and Sun, Philip and Lindgren, Erik and Geng, Quan and Simcha, David and Chern, Felix and Kumar, Sanjiv},
  booktitle={International Conference on Machine Learning},
  year={2020},
  URL={https://arxiv.org/abs/1908.10396}
}
```
## Installation

`manylinux_2_27`-compatible wheels are available on PyPI:

```
pip install scann
```

ScaNN supports Linux environments running Python versions 3.9-3.12. See
[docs/releases.md](https://github.com/google-research/google-research/blob/master/scann/docs/releases.md) for release notes; the page also contains
download links for ScaNN wheels prior to version 1.1.0, which were not released
on PyPI.

In accordance with the
[`manylinux_2_27` specification](https://peps.python.org/pep-0600/), ScaNN
requires `libstdc++` version 3.4.23 or above from the operating system. See
[here](https://stackoverflow.com/questions/10354636) for an example of how
to find your system's `libstdc++` version; it can generally be upgraded by
installing a newer version of `g++`.

### Integration with TensorFlow Serving

We provide custom Docker images of
[TF Serving](https://github.com/tensorflow/serving) that are linked to the ScaNN
TF ops. See the [`tf_serving` directory](tf_serving/README.md) for further
information.

## Building from source

To build ScaNN from source, first install the build tool
[bazel](https://bazel.build), Clang 16, and libstdc++ headers for C++17 (which
are provided with GCC 9). Additionally, ScaNN requires a modern version of
Python (3.9.x or later) and Tensorflow 2.16 installed on that version of Python.
Once these prerequisites are satisfied, run the following command in the root
directory of the repository:

```
python configure.py
CC=clang-16 bazel build -c opt --features=thin_lto --copt=-mavx --copt=-mfma --cxxopt="-std=c++17" --copt=-fsized-deallocation --copt=-w :build_pip_pkg
./bazel-bin/build_pip_pkg
```

A .whl file should appear in the root of the repository upon successful
completion of these commands. This .whl can be installed via pip.

## Usage

See the example in [docs/example.ipynb](https://github.com/google-research/google-research/blob/master/scann/docs/example.ipynb). For a more in-depth
explanation of ScaNN techniques, see [docs/algorithms.md](https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/google-research/google-research/tree/master/scann",
    "name": "scann",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "machine learning",
    "author": "Google Inc.",
    "author_email": "opensource@google.com",
    "download_url": null,
    "platform": null,
    "description": "\n# ScaNN\n\nScaNN (Scalable Nearest Neighbors) is a method for efficient vector similarity\nsearch at scale. This code release implements [1], which includes search space\npruning and quantization for Maximum Inner Product Search and also supports\nother distance functions such as Euclidean distance. The implementation is\ndesigned for x86 processors with AVX2 support. ScaNN achieves state-of-the-art\nperformance on [ann-benchmarks.com](http://ann-benchmarks.com) as shown on the\nglove-100-angular dataset below:\n\n![glove-100-angular](https://github.com/google-research/google-research/raw/master/scann/docs/glove_bench.png)\n\nScaNN can be configured to fit datasets with different sizes and distributions.\nIt has both TensorFlow and Python APIs. The library shows strong performance\nwith large datasets [1]. The code is released for research purposes. For more\ndetails on the academic description of algorithms, please see [1].\n\nReference [1]:\n```\n@inproceedings{avq_2020,\n  title={Accelerating Large-Scale Inference with Anisotropic Vector Quantization},\n  author={Guo, Ruiqi and Sun, Philip and Lindgren, Erik and Geng, Quan and Simcha, David and Chern, Felix and Kumar, Sanjiv},\n  booktitle={International Conference on Machine Learning},\n  year={2020},\n  URL={https://arxiv.org/abs/1908.10396}\n}\n```\n## Installation\n\n`manylinux_2_27`-compatible wheels are available on PyPI:\n\n```\npip install scann\n```\n\nScaNN supports Linux environments running Python versions 3.9-3.12. See\n[docs/releases.md](https://github.com/google-research/google-research/blob/master/scann/docs/releases.md) for release notes; the page also contains\ndownload links for ScaNN wheels prior to version 1.1.0, which were not released\non PyPI.\n\nIn accordance with the\n[`manylinux_2_27` specification](https://peps.python.org/pep-0600/), ScaNN\nrequires `libstdc++` version 3.4.23 or above from the operating system. See\n[here](https://stackoverflow.com/questions/10354636) for an example of how\nto find your system's `libstdc++` version; it can generally be upgraded by\ninstalling a newer version of `g++`.\n\n### Integration with TensorFlow Serving\n\nWe provide custom Docker images of\n[TF Serving](https://github.com/tensorflow/serving) that are linked to the ScaNN\nTF ops. See the [`tf_serving` directory](tf_serving/README.md) for further\ninformation.\n\n## Building from source\n\nTo build ScaNN from source, first install the build tool\n[bazel](https://bazel.build), Clang 16, and libstdc++ headers for C++17 (which\nare provided with GCC 9). Additionally, ScaNN requires a modern version of\nPython (3.9.x or later) and Tensorflow 2.16 installed on that version of Python.\nOnce these prerequisites are satisfied, run the following command in the root\ndirectory of the repository:\n\n```\npython configure.py\nCC=clang-16 bazel build -c opt --features=thin_lto --copt=-mavx --copt=-mfma --cxxopt=\"-std=c++17\" --copt=-fsized-deallocation --copt=-w :build_pip_pkg\n./bazel-bin/build_pip_pkg\n```\n\nA .whl file should appear in the root of the repository upon successful\ncompletion of these commands. This .whl can be installed via pip.\n\n## Usage\n\nSee the example in [docs/example.ipynb](https://github.com/google-research/google-research/blob/master/scann/docs/example.ipynb). For a more in-depth\nexplanation of ScaNN techniques, see [docs/algorithms.md](https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md).\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Scalable Nearest Neighbor search library",
    "version": "1.3.2",
    "project_urls": {
        "Homepage": "https://github.com/google-research/google-research/tree/master/scann"
    },
    "split_keywords": [
        "machine",
        "learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "772090cad3b63da8052cbebd0b61fb30ea94bf0f14edbd811d580daa1c0250c8",
                "md5": "452f34d10a70ce5a3cdc764e570c2754",
                "sha256": "36756afc0a8782a40dba23a59968e145abe6c0d770daba36367cf712a02fda9b"
            },
            "downloads": -1,
            "filename": "scann-1.3.2-cp310-cp310-manylinux_2_27_x86_64.whl",
            "has_sig": false,
            "md5_digest": "452f34d10a70ce5a3cdc764e570c2754",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 10638078,
            "upload_time": "2024-05-07T18:07:02",
            "upload_time_iso_8601": "2024-05-07T18:07:02.147314Z",
            "url": "https://files.pythonhosted.org/packages/77/20/90cad3b63da8052cbebd0b61fb30ea94bf0f14edbd811d580daa1c0250c8/scann-1.3.2-cp310-cp310-manylinux_2_27_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fcd036d364f77b2d2e0642875b491408ad72c0b9809e623153aff48ffebab816",
                "md5": "ae406db7612312b7d6707154e7f2e625",
                "sha256": "ccbb3618d12308d4d0feb42b593425ab97d790d18798f84f0a5383a05a57c5b6"
            },
            "downloads": -1,
            "filename": "scann-1.3.2-cp311-cp311-manylinux_2_27_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ae406db7612312b7d6707154e7f2e625",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 10640273,
            "upload_time": "2024-05-07T18:07:04",
            "upload_time_iso_8601": "2024-05-07T18:07:04.801313Z",
            "url": "https://files.pythonhosted.org/packages/fc/d0/36d364f77b2d2e0642875b491408ad72c0b9809e623153aff48ffebab816/scann-1.3.2-cp311-cp311-manylinux_2_27_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "300b53fb162ef5137be343e52aa80d3095a46d072f629ce510be224872236a0a",
                "md5": "a978a7535ee1351c8a8c01557545ba39",
                "sha256": "fa12bcb392b8066b83b00526a1a247e28011921e34484f9bc854a8ee93c87672"
            },
            "downloads": -1,
            "filename": "scann-1.3.2-cp312-cp312-manylinux_2_27_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a978a7535ee1351c8a8c01557545ba39",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": null,
            "size": 10641448,
            "upload_time": "2024-05-07T18:07:07",
            "upload_time_iso_8601": "2024-05-07T18:07:07.848668Z",
            "url": "https://files.pythonhosted.org/packages/30/0b/53fb162ef5137be343e52aa80d3095a46d072f629ce510be224872236a0a/scann-1.3.2-cp312-cp312-manylinux_2_27_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d2b524709d25dc16eae3f9feb480822361f5bacb53f22c486888fc9360460ef",
                "md5": "bc791bf7142f8927a06e42aaba5d0294",
                "sha256": "aa225587e262aa3c1779d2778d6327192330920ba244c9cc5e93eb766c85f281"
            },
            "downloads": -1,
            "filename": "scann-1.3.2-cp39-cp39-manylinux_2_27_x86_64.whl",
            "has_sig": false,
            "md5_digest": "bc791bf7142f8927a06e42aaba5d0294",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 10638379,
            "upload_time": "2024-05-07T18:07:10",
            "upload_time_iso_8601": "2024-05-07T18:07:10.811702Z",
            "url": "https://files.pythonhosted.org/packages/7d/2b/524709d25dc16eae3f9feb480822361f5bacb53f22c486888fc9360460ef/scann-1.3.2-cp39-cp39-manylinux_2_27_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-07 18:07:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "google-research",
    "github_project": "google-research",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "lcname": "scann"
}
        
Elapsed time: 0.30182s