-
Notifications
You must be signed in to change notification settings - Fork 20
[MOD-8200] [MOD-8202] INT8 index #566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
2f34c15
naive implementation of L2
meiravgri c641d23
update
meiravgri 1c5eb90
implment naive disatnce for int8
meiravgri fa8e9ff
imp choose L2 int8 with 256bit loop
meiravgri a7a556f
imp space bm for int8
meiravgri 43064e8
fix INITIALIZE_BENCHMARKS_SET_L2_IP and add include to F_BW_VL_VNNI
meiravgri fb9f1cc
rename unit/test_utuils to unit_test_utils
meiravgri 602f8e9
seed create vec
meiravgri cde5e2d
format
meiravgri cdb4d7f
implmenet IP + unit test
meiravgri 5f01890
ip bm
meiravgri 2dce6f0
format
meiravgri 3d3b375
implement cosine in ip API
meiravgri 6f211b3
use mask sub instead of msk load
meiravgri 6ac65a3
loop size = 512
meiravgri 0d07c5d
add int8 to bm
meiravgri 3586a76
reanme to simd64
meiravgri adbc4d7
convert to int before multiplication
meiravgri 03be854
introduce IntegralType_ComputeNorm
meiravgri a26e8c9
move preprocessor logic to choose if cosine preprocessor is needed to…
meiravgri c32e4fb
add int8 tests
meiravgri de6769d
fix include unint_test_utils
meiravgri 3e3c14f
Merge branch 'meiravg_feature_int_uint_8' into meiravg_compute_norm
meiravgri f4598d3
add int 8 to index factories
meiravgri d5b7d27
add EstimateInitialSize for int8 to indexes factories
meiravgri ef9beb6
add int8 unit tests
meiravgri 0f2b65d
Merge remote-tracking branch 'origin/meiravg_feature_int_uint_8' into…
meiravgri b7d6aed
remove duplicated GetDistFunc<int8_t, float>
meiravgri 939cc47
remove assert test, the statement is excuted and causes crash
meiravgri e3ad80c
imporve normalize test
meiravgri 58fa8e2
rename test_utils::compute_norm -> test_utils::integral_compute_norm
meiravgri 736e30b
use stack allocation instead of heap allocation in tests
meiravgri 4a9bb69
fix float comparison in test_serialization
meiravgri 9796d59
renae CalcIndexDataSize -> CalcVectorDataSize
meiravgri 21520ad
add comment to INSTANTIATE_TEST_SUITE_P
meiravgri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
*Copyright Redis Ltd. 2021 - present | ||
*Licensed under your choice of the Redis Source Available License 2.0 (RSALv2) or | ||
*the Server Side Public License v1 (SSPLv1). | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cmath> | ||
|
||
namespace spaces { | ||
|
||
template <typename DataType> | ||
static inline float IntegralType_ComputeNorm(const DataType *vec, const size_t dim) { | ||
int sum = 0; | ||
|
||
for (size_t i = 0; i < dim; i++) { | ||
// No need to cast to int because c++ integer promotion ensures vec[i] is promoted to int | ||
// before multiplication. | ||
sum += vec[i] * vec[i]; | ||
} | ||
return sqrt(sum); | ||
} | ||
|
||
} // namespace spaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.