Comments (4)
Hi @huhk-sysu
Information about mmap
can be found at the link below.
As you can see on the wiki, mmap
is implemented with demand paging. When index.load()
is called with use_mmap=True
, index read doesn't actually occur. When accessing the index, reading occurs in a lazy manner. This is why your index.load()
takes no time and search takes a long time. But the 1.5 minute seems weird.
Load with mmap
is suitable in multi-process environments because it allows share memory. If you only use ad single process, it is recommended to use it with use_mmap=False
.
from n2.
Thanks for your detailed explanation. The 1.5 minute may due to the machine, though it's not so clear. Since I'm using single process, I will trying loading with use_mmap=False
.
There's another question: In fact I have a large database (~15 million * 768), but my machine's memory is limited and I can't build an index for it. For the moment I split it and build 15 indexes, each one contains 1 million data. Then I load the indexes, when the query comes, I query each of them, and finally aggregate the results. I wonder if it is the suitable way, any suggestions?
from n2.
Well, if there is not enough memory, you can use it the way you said. There is no way for N2 to process data larger than the machine's memory yet, but improvements are being made to handle data larger than memory through Product Quantization. The improvement is expected to be available early next year.
from n2.
Thanks for your advises.
from n2.
Related Issues (20)
- Windows installation issue HOT 1
- With the same accuracy, the number of comparisons with the paper is very different. HOT 3
- The core idea behind this library
- Does it support online vector deletion and insertion? HOT 1
- Can't install into Conda environment on macOS Big Sur HOT 1
- How dose n2 handle zero vectors? HOT 3
- Duplicate vector handling HOT 3
- multiple indices HOT 1
- Support Hamming-Distance
- Cannot use with pytorch due to libgomp issue HOT 1
- missing xmmintrin.h on ARM devices. HOT 1
- [Go binding] Linux make error: make: *** [go] Error 1
- Custom Metric
- N2 in Big-ANN-Benchmarks NeurIPS'21 Challenge?
- `Library not loaded: /usr/local/opt/gcc/lib/gcc/10/libgomp.1.dylib` HOT 1
- What are the right parameter ?
- extended candidates and keep pruned
- Windows installation HOT 1
- Can we add support for PPC big endian?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from n2.