Comments (4)
same result from my side.
looks like a bug of search with metadata.
repro steps.
copy attached query_embeddings.txt and title_embeddings.txt file.
These're 2048d vector with simple metadata file.
Run below commands and check results.txt file.
./indexbuilder -d 2048 -v Float -i ../shane-test/query_embeddings.txt -o ../output3 -a BKT
./indexsearcher ../output3 Index.QueryFile=../shane-test/title_embeddings.txt Index.ResultFile=../output3/results.txt Index.K=2
First line of first prediction looks okay but next, errors.
the broken text, it should be t2 metadata name value but might be some encoding? or text printing issues on it.
results.txt file text
m1:0.680@t1|0.998@`�|
m2:0.654@��|0.973@`�|
m3:0.719@��|0.980@`�|
m4:0.753@��|0.978@`�|
m5:0.707@��|0.994@`�|
m6:0.696@��|1.001@`�|
m7:0.755@��|0.985@`�|
m8:0.720@��|1.002@`�|
m9:0.833@��|0.975@`�|
m10:0.723@��|1.000@`�|
m11:0.680@��|0.998@`�|
m12:0.654@��|0.973@`�|
m13:0.719@��|0.980@`�|
m14:0.753@��|0.978@`�|
m15:0.707@��|0.994@`�|
m16:0.696@��|1.001@`�|
m17:0.755@��|0.985@`�|
m18:0.720@��|1.002@`�|
m19:0.833@��|0.975@`�|
m20:0.723@��|1.000@`�|
attaching the test files.
SPTAG-result-with-metadata.zip
from sptag.
I spent a bit of time debugging this the other day, and seemed to find that inserting elements one at a time (using AddIndex) resolved it. Relatively slow, but maybe that's a hint toward what might be at play?
from sptag.
Faced the same issue on Windows. I was trying with dummy vectors of dimension 10.
- Here's the input file to the index builder executable (target.txt).
hello 100|101|103|104|105|106|107|108|109|110
hullo 99|100|101|103|104|105|106|107|108|109
hola 85|86|87|88|89|90|91|92|93|94
hi 120|121|122|123|124|125|126|127|119|118
what's up -10|-11|-12|-13|-14|-15|-16|-17|-18|-19
- Ran index builder
indexbuilder.exe -d 10 -v float -i D:\path\to\data\target.txt -o D:\path\to\data\gen -a BKT Index.DistCalcMethod=Cosine
- My search input file (source.txt)
this -120|-121|-122|-123|-124|-125|-126|-127|-128|-129
magnificiant 250|251|252|253|254|255|256|257|258|259
helloo 101|102|103|104|105|106|107|108|109|120
hwllo 98|99|100|101|102|103|104|105|106|107
search 1|2|3|4|5|6|7|8|9|10
- Ran index search
indexsearcher.exe D:\path\to\data\gen Index.QueryFile=D:\path\to\data\source.txt Index.ResultFile=D:\path\to\data\gen\result.txt Index.K=4
- Content of result.txt
this:2.000@ ðÂC|2.000@C |2.000@C |2.000@¸$P}÷� |
magnificiant:0.000@C |0.000@l e |0.000@C |0.000@ |
helloo:0.000@ C|0.001@ C|0.001@C |0.001@� |
hwllo:0.000@C �Åî|0.000@ C|0.000@C |0.000@� |
search:0.100@ ðÂC|0.114@C |0.114@C |0.114@C |
I don't know what to make of it. Any help is appreciated.
from sptag.
Okay not sure how much it helps, but this is something I tried with the index searcher.
- Removed the
if (...)
thing here and theelse
block. So this is how it looks in my local
for (int j = 0; j < K; j++)
{
//if (results[i].GetResult(j)->VID < 0) {
fp << results[i].GetResult(j)->Dist << "@" << results[i].GetResult(j)->VID; // << std::endl;
//}
/*else {
ByteArray vm = index.GetMetadata(results[i].GetResult(j)->VID);
fp << (results[i].GetResult(j)->Dist / basesquare) << "@";
fp.write((const char*)vm.Data(), vm.Length());
}*/
fp << "|";
}
-
Increased the precision here to 6 (since the distance is float32_t so we can't get better than that).
-
Output file:
this:1.999734@1|1.999734@2|1.999734@3|1.999734@4|
magnificiant:0.000064@1|0.000064@2|0.000064@3|0.000064@4|
helloo:0.000382@0|0.001155@1|0.001155@2|0.001155@3|
hwllo:0.000005@0|0.000392@1|0.000392@2|0.000392@3|
search:0.100150@0|0.113595@1|0.113595@2|0.113595@3|
from sptag.
Related Issues (20)
- Dockerfile doesn't work
- Logger is not configurable until after it's been used
- SPATAG build failure with cmake HOT 3
- Not enough memory on host devices offered by Azure
- thread local context (#359) causes test issue on Linux: `1: [4] fid:0 channel 2, to submit:64, submitted:Operation not permitted` HOT 18
- This repo is missing important files
- build failure with GCC 13 due to missing `#include <cstdint> in `AnnService/inc/Helper/DiskIO.h`
- index.Save function doesn't create the file on disk HOT 1
- How to Search SPANN SSD Index???
- Import SPTAG Failed
- Missing m_SPTQueue.insert()?
- [QUESTION] How to start a online server for service.ini?
- Multiple connection for one server (to be assigned for each client)
- How to use distribute server? HOT 2
- compile failed with bug
- KMeans clustering
- Improve the BalancedDataPartition program
- Building a 1000W BKT index crashes
- Unable to download vectors_9.bin and vectors_12.bin using git lfs pull
- double free or corruption (out) during Search
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 sptag.