-
Notifications
You must be signed in to change notification settings - Fork 143
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
Clustering & Minor Patches in JS, Rust, & Java SDKs #503
Merged
Conversation
This file contains 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
The return value of index.count() was a boolean, so it was changed to a number.
For example, if you try to add the same key, it aborts. ``` terminate called after throwing an instance of 'std::runtime_error' what(): Duplicate keys not allowed in high-level wrappers Aborted (core dumped) ``` Improved error handling to throw JavaScript exceptions.
ashvardanian
changed the title
JS, Rust, and Java Patches
Clustering & Minor Patches in JS, Rust, & Java SDKs
Oct 10, 2024
I got an error when I loaded and searched with load() or view(). Code Example: ```js // Saved with `index.save('index.usearch');` in another script. index.load('index.usearch'); const results = index.search(new Float32Array([0.2, 0.6, 0.4]), 10); ```
@abetomo, the last PR seems to break the CI. Any ideas, why? |
The test itself succeeds, but fails with the following error when deleting the index file created by save() in afterEach(). ``` error: "EBUSY: resource busy or locked, unlink 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\usearch.test.index'" ``` Since it is only in Winodws that it fails, we will skip it on Winodws for now. We will continue to investigate the solution.
Add Rust and Android CI build
The index read by `view()` is read-only. When I did a `remove()` on that index, it crashed. --------- Co-authored-by: Ash Vardanian <[email protected]>
--------- Co-authored-by: Mikhail Bautin <[email protected]>
Related: GH-506
Remove `fire` dependency and document usage.
Without this the the Java build on Ubuntu with GCC fails.
The `<numeric>` header that contains that function brings up to 2K lines of templates.
The previous solution failed on Windows with: > ValueError: high is out of bounds for int32
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Many data scientists embark on their journey by implementing K-Means clustering, much like app developers starting with a calculator. But despite K-Means’ popularity, most implementations overlook the power of SIMD on modern CPUs. Efficient vector math, especially with single- and double-precision floating-point vectors, is challenging due to the computational cost of accuracy. Meanwhile,
float16
,bfloat16
, and smaller types can fail under uneven distributions or when computing centroids for large clusters. So, what’s Unum’s solution? Mixed precision!Thanks to strong community support and sponsorship from @sutoiku (LinkedIn, Website), we're introducing a high-performance K-Means implementation! It utilizes any numeric type for distance calculations, switching to
float64
for centroid updates, a technique that boosts performance and enables billion-scale clustering on a single machine.