ANSMET is a HW-SW co-design that integrates near-data processing architectures with a novel hybrid partial-dimension/bit early termination strategy to accelerate approximate nearest neighbor search.
- The ANSMET simulator is built upon Ramulator 2.0 and hnswlib
- A C++20 compatible compiler is required for building Ramulator 2.0
Clone the repository:
$ git clone https://github.com/tsinghua-ideal/ANSMETBuild up the executable:
$ mkdir build
$ cd build
$ cmake ..
$ make -j
$ cd ..This should generate a ramulator2 executable.
To run a testcase:
$ cd run-template
$ ./run.sh cpu.yaml # CPU baseline
$ ./run.sh ansmet.yaml # ANSMETIf configured correctly, the terminal will display the execution output. You should see the simulated memory cycle improvement using ANSMET.
We have incorporated a small dataset in datasets folder. Please refer to our paper for more dataset download links.
After downloaded, we use hnswlib to export to .bin file, please refer to https://github.com/nmslib/hnswlib/blob/master/examples/python/EXAMPLES.md
We provide shell scripts to automate testing across different datasets and parameters:
$ ./run_k_1.sh # top_k = 1
$ ./run_k_5.sh # top_k = 5
$ ./run_k_10.sh # top_k = 10Note: The required YAML configuration files are automatically generated by ./yaml_generate/generate_yamls.py
You can create custom test cases by modifying parameters in the YAML configuration files:
-
earlyExitEnable: Enables early termination when True -
allowSample: Enables sampling and dual-granularity fetch when True -
allowoutlier: Enables common prefix elimination when True
If you use this codebase, please cite:
@misc{ansmet_isca25,
author = {Yiwei Li and Yuxin Jin and Boyu Tian and Huanchen Zhang and Mingyu Gao},
title = {{ANSMET: Approximate Nearest Neighbor Search with Near-Memory Processing and Hybrid Early Termination}},
booktitle = {52nd International Symposium on Computer Architecture (ISCA)},
year = {2025},
month = {Jun},
location = {Tokyo, Japan},
}