ashvardanian / SimSIMD

Up to 200x Faster Dot Products & Similarity Metrics — for Python, Rust, C, JS, and Swift, supporting f64, f32, f16 real & complex, i8, and bit vectors using SIMD for both AVX2, AVX-512, NEON, SVE, & SVE2 📐
https://ashvardanian.com/posts/simsimd-faster-scipy/
Apache License 2.0
988 stars 59 forks source link

Rewrite benchmarks with `perfplot` charts #193

Closed ashvardanian closed 1 month ago

ashvardanian commented 1 month ago

Describe what you are looking for

Current benchmarking suite is quite flexible and accurate, but its output can be improved to include dynamic perfplot charts.

Can you contribute to the implementation?

Is your feature request specific to a certain interface?

Python bindings

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

jimthompson5802 commented 1 month ago

@ashvardanian I started working on this. I'd like to confirm the scope of this work is to modify bench.py only.

It appears benchmark.py is affected by this Issue #194. As a temporary work-around, I've modified code like this from

            (
                "scipy.cosine",
                lambda A, B: spd.cdist(A, B, "cosine"),
                lambda A, B: simd.cdist(A, B, "cosine"),
                [np.float32, np.float16, np.int8],
            ),

to

            (
                "scipy.cosine",
                lambda A, B: spd.cdist(A, B, "cosine"),
                lambda A, B: simd.cdist(A, B, metric="cosine"),
                [np.float32, np.float16, np.int8],
            ),
jimthompson5802 commented 1 month ago

@ashvardanian a few more clarifying questions.

ashvardanian commented 1 month ago

Hi @jimthompson5802! Frankly, I am not sure, what's the cleanest way to implement this. The current benchmark seems quite convoluted and poorly documented, but accomplishes many things and covers a lot of functionality.

Maybe we should split it into multiple parts. You probably have no less experience with charts and visualizations than I do, so I trust your judgement on various approaches and we can iterate together once a draft is ready 🤗

As for --ndim vs --n, having 2 variables is clear path to 3d charts... Most of the time those are unreadable, but maybe this can be an exception. Alternatively, showing the dependence on --ndim is much more important than --n.

Thanks for help!