SimSIMD
avo
SimSIMD | avo | |
---|---|---|
15 | 10 | |
715 | 2,598 | |
- | - | |
9.6 | 7.0 | |
22 days ago | about 1 month ago | |
C | Go | |
Apache License 2.0 | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
SimSIMD
- Deep Learning in JavaScript
-
From slow to SIMD: A Go optimization story
For other languages (including nodejs/bun/rust/python etc) you can have a look at SimSIMD which I have contributed to this year (made recompiled binaries for nodejs/bun part of the build process for x86_64 and arm64 on Mac and Linux, x86 and x86_64 on windows).
[0] https://github.com/ashvardanian/SimSIMD
-
Python, C, Assembly โ Faster Cosine Similarity
Kahan floats are also commonly used in such cases, but I believe there is room for improvement without hitting those extremes. First of all, we should tune the epsilon here: https://github.com/ashvardanian/SimSIMD/blob/f8ff727dcddcd14...
As for the 64-bit version, its harder, as the higher-precision `rsqrt` approximations are only available with "AVX512ER". I'm not sure which CPUs support that, but its not available on Sapphire Rapids.
- Beating GCC 12 - 118x Speedup for Jensen Shannon Divergence via AVX-512FP16
- Show HN: Beating GCC 12 โ 118x Speedup for Jensen Shannon D. Via AVX-512FP16
- SimSIMD v2: Vector Similarity Functions 3x-200x Faster than SciPy and NumPy
-
Show HN: SimSIMD vs. SciPy: How AVX-512 and SVE make SIMD cleaner and ML faster
I encourage one to merge into e.g. {NumPy, SciPy, }; are there PRs?
Though SymPy.physics only yet supports X,Y,Z vectors and doesn't mention e.g. "jaccard"?, FWIW: https://docs.sympy.org/latest/modules/physics/vector/vectors... https://docs.sympy.org/latest/modules/physics/vector/fields.... #cfd
include/simsimd/simsimd.h: https://github.com/ashvardanian/SimSIMD/blob/main/include/si...
conda-forge maintainer docs > Switching BLAS implementation:
-
SimSIMD v2: 3-200x Faster Vector Similarity Functions than SciPy and NumPy
Hello, everybody! I was working on the next major release of USearch, and in the process, I decided to generalize its underlying library - SimSIMD. It does one very simple job but does it well - computing distances and similarities between high-dimensional embeddings standard in modern AI workloads.
- Comparing Vectors 3-200x Faster than SciPy and NumPy
-
Show HN: U)Search Images demo in 200 lines of Python
Hey everyone! I am excited to share updates on four of my & my teams' open-source projects that take large-scale search systems to the next level: USearch, UForm, UCall, and StringZilla. These projects are designed to work seamlessly together, end-to-endโcovering everything from indexing and AI to storage and networking. And yeah, they're optimized for x86 AVX2/512 and Arm NEON/SVE hardware.
USearch [1]: Think of it as Meta FAISS on steroids. It's now quicker, supports clustering of any granularity, and offers multi-index lookups. Plus, it's got more native bindings than probably all other vector search engines combined: C++, C, Python, Java, JavaScript, Rust, Obj-C, Swift, C#, GoLang, and even slightly outdated bindings for Wolfram. Need to refresh that last one!
UForm v2 [2]: Imagine a much smaller OpenAI CLIP but more efficient and trained on balanced multilingual datasets, with equal exposure to languages from English, Chinese, and Hindi to Arabic, Hebrew, and Armenian. UForm now supports 21 languages, is so tiny that you can run it in the browser, and outputs small 256-dimensional embeddings. Perfect for rapid image and video searches. It's already available on Hugging-Face as "unum-cloud/uform-vl-multilingual-v2".
UCall [3]: It started as a FastAPI alternative focusing on JSON-RPC (instead of REST protocols), offering 70x the bandwidth and 1/50th the latency. It was good but not enough, so we've added REST and TLS support, broadening its appeal. I've merged that code, and it is yet to be tested. Early benchmarks suggest that we still hit the same 150'000-250'000 requests/s on a single CPU core in Python by reusing HTTPS connections.
StringZilla [4]: This project lets you sift through multi-gigabyte or terabyte strings with minimal use of RAM and maximal use of SIMD and SWAR techniques.
All these projects are engineered for scalability and efficiency, even on tight budgets. Our demo, for instance, works on hundreds of gigabytes of images using just a few gigabytes of RAM and no GPUs for AI inference. That is a toy example with a small, noisy dataset, and I look forward to showing a much larger setup. Interestingly, even this tiny setup illustrates issues common to UForm and much larger OpenAI CLIP models - the quality of Multi-Modal alignment [5]. It also shows how different/accurate the search results are across different languages. Synthetic benchmarks suggest massive improvements for some low-resource languages (like Armenian and Hebrew) and more popular ones (like Hindi and Arabic) [6]. Still, when we look at visual demos like this, I can see a long road ahead for us and the broader industry, making LLMs Multi-Modal in 2024 :)
All of the projects and the demo code are available under an Apache license, so feel free to use them in your commercial projects :)
PS: The demo looks much nicer with just Unsplash dataset of 25'000 images, but it's less representative of modern AI datasets, too small, and may not be the best way to honestly show our current weaknesses. The second dataset - Conceptual Captions - is much noisier, and quite ugly.
[1]: https://github.com/unum-cloud/usearch
avo
-
From slow to SIMD: A Go optimization story
I wonder whether avo could have been useful here?[1] I mention it because it came up the last time we were talking about AVX operations in go.[2]
1 = https://github.com/mmcloughlin/avo
2 = https://news.ycombinator.com/item?id=34465297
- Portable Efficient Assembly Code-Generator in Higher-Level Python (PeachPy)
-
How to Use AVX512 in Golang
I thought the /r/golang comments on this post were pretty useful[1]. They also introduced me to avo[2], a tool for generating x86 assembly from go that I hadn't seen before. There are some examples listed on the avo github page for generating AVX512 instructions with avo.
1 = https://www.reddit.com/r/golang/comments/10hmh07/how_to_use_...
2 = https://github.com/mmcloughlin/avo
For writing AVX512 from scratch avo is a much better alternative.
-
SIMD Accelerated vector math
Avo is a library that simplifies writing complex go assembly, I found it very useful to figure out how instructions map onto Go's asm syntax. But you could definitely do the translation directly, it's what c2goasm did (couldn't get it to work reliably unfortunately).
-
HaxMap v0.2.0 released, huge performance improvements and added support for 32-bit systems
Curious if you're looking at using avo to write the assembly
-
HaxMap, a concurrent hashmap faster and more memory-efficient than golang's sync.Map
You can use github.com/mmcloughlin/avo for generating the assembly use Go.
-
S2: Fully Snappy compatible compression, faster and better
For normal and "better" mode I am using avo to generate different encoders for different input sizes, with and without Snappy compatibility. That currently outputs about 17k lines of assembly.
-
Branchless Coding in Go (Golang)
You could perhaps just have the Go compiler generate the assembler for your code:
go tool compile -S file.go > file_amd64.s
Then you could verify it doesn't change over time, and choose to begin maintaining by hand if it makes sense.
If you do want to go the route of rolling it yourself, I'd suggest looking into something like Avo: https://github.com/mmcloughlin/avo
-
High precision timer loop.
If you have to go with Assembly, try Avo https://github.com/mmcloughlin/avo
What are some alternatives?
kuzu - Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
sonic - A blazingly fast JSON serializing & deserializing library
nsimd - Agenium Scale vectorization library for CPUs and GPUs
sha256-simd - Accelerate SHA256 computations in pure Go using AVX512, SHA Extensions for x86 and ARM64 for ARM. On AVX512 it provides an up to 8x improvement (over 3 GB/s per core). SHA Extensions give a performance boost of close to 4x over native.
numpy-feedstock - A conda-smithy repository for numpy.
dingo - Generated dependency injection containers in go (golang)
mkl_random-feedstock - A conda-smithy repository for mkl_random.
rjson - A fast json parser for go
usearch - Fast Open-Source Search & Clustering engine ร for Vectors & ๐ Strings ร in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram ๐
gorse - Gorse open source recommender system engine
xtensor-fftw - FFTW bindings for the xtensor C++14 multi-dimensional array library
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.