Comments (3)
There are two ways of doing this. Assume data is given in d
nibbles:
a0 a1 a2 ... ad <- Row of 4 * d bits
b0 b1 b2 ... bd
...
Then we can use the normal QuickADC format:
=====================
a0 a1 b0 b1 ... h0 h1 <- 64 bits
i0 i1 ... p0 p1 <- 64 bits
=====================
a2 a3 b2 b3 ... h2 h3 <- If using AVX we'll read these 128 bits
i2 i3 ... p2 p3 together with the previous 128 bits, so we must have d % 4 = 0.
=====================
...
i(d-1) id ... p(d-1) pd
=====================
q0 q1 r0 ... <- Beginning of new New chunk
...
=====================
In this case, AVX eating 256 bits at a time, will take the two rows
=====================
a0 a1 b0 b1 ... h0 h1
i0 i1 ... p0 p1
=====================
a2 a3 b2 b3 ... h2 h3
i2 i3 ... p2 p3
=====================
Meaning we need a dimension divisible by 4.
Alternatively, we could use the second channel to handle some more vectors
=====================
a0 a1 b0 b1 ... h0 h1
i0 i1 ... p0 p1
=====================
q0 q1 r0 r1 ... x0 x1
y0 y1 ...
=====================
Computing the distance to 32 vectors at a time, instead of 16 at a time.
QuickADC suggests the first approach, which has the advantage of using the same memory format, but I don't know exactly why it should be better.
from tinyknn.
I added the first version of AVX in 95751ae.
from tinyknn.
Do we have any issues with mixing SSE and AVX?
https://www.intel.com/content/dam/develop/external/us/en/documents/11mc12-avoiding-2bavx-sse-2btransition-2bpenalties-2brh-2bfinal-809104.pdf
from tinyknn.
Related Issues (17)
- Add support for AVX, Neon etc.
- Nearest Neighbour Search
- Add support for signed addition
- Add package to PyPi HOT 1
- Better support for storing points in multiple lists HOT 4
- Use separate PQs in each cluster HOT 2
- Add numba HOT 1
- Missing convert.py HOT 2
- Support estimating distance between two compressed datasets HOT 2
- Tests get stuck with python3.9 HOT 2
- Build PIP package HOT 1
- Support multi-ivf
- Faster building / batch-insert using compression
- Add typing
- Use AVX-512 HOT 1
- [bug] Can't compile or install from pip.
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 tinyknn.