Skip to content
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

[Limitation] Maximum number of non-zero elements must be < Int32.Max #42

Closed
michabirklbauer opened this issue Apr 19, 2024 · 0 comments
Closed
Assignees
Labels
documentation Improvements or additions to documentation info Information that might be important wontfix This will not be worked on

Comments

@michabirklbauer
Copy link
Member

The current implementation uses the signed int32 data type to keep track of the number of non-zero elements in the matrices. Therefore the number of non-zero elements must no exceed 2 147 483 647 or otherwise unexpected behaviour will occur!

In case matrices with more than 2 * 109 non-zero elements are expected, any variable keeping track of the non-zero elements needs to have its data type changed! This applies to both the C# code as well as the C++ code!

Here's an example:

int* findTopCandidates(int* candidatesValues, int* candidatesIdx,
int* spectraValues, int* spectraIdx,
int cVLength, int cILength,
int sVLength, int sILength,
int n, float tolerance,
bool normalize, bool gaussianTol,
int cores, int verbose) {

cVLength as well as variables that use cVLength would need to be changed to long or int64_t. For safety it would be recommended to do the same for cILength, sVLength and sILength - even though it might not be necessary.

Wherever this function (or any of the other matrix multiplication functions) is used on the C# side, the types need to be adjusted as well (to long) - most importantly in the VectorSearchInterface.

We will not supply an implementation for matrices of this size but are happy to assist in case help is needed!

@michabirklbauer michabirklbauer added documentation Improvements or additions to documentation wontfix This will not be worked on labels Apr 19, 2024
@michabirklbauer michabirklbauer pinned this issue Apr 19, 2024
@michabirklbauer michabirklbauer added the info Information that might be important label Apr 19, 2024
@michabirklbauer michabirklbauer self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation info Information that might be important wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant