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

Feature: Heuristics for choosing a SIMD variant over the corresponding scalar non-SIMD version #184

Open
3 tasks done
nordlow opened this issue Oct 22, 2024 · 2 comments
Open
3 tasks done
Labels
enhancement New feature or request

Comments

@nordlow
Copy link

nordlow commented Oct 22, 2024

Describe what you are looking for

For a given function f, are there any (typically architecture-specific) heuristics for when a SIMD version opposite to a serial version of an algorithm should be chosen?

For instance, for

sz_find(sz_cptr_t haystack, sz_size_t h_length, sz_cptr_t needle, sz_size_t n_length) {

one such heuristics could be

bool useSIMD(size_t h_length, size_t n_length) {
    if (h_length > 1024) {
        return true;
    } else if (h_length / n_length >= 4) {
        return true;
    }
}

.

Can you contribute to the implementation?

  • I can contribute

Is your feature request specific to a certain interface?

It applies to everything

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nordlow nordlow added the enhancement New feature or request label Oct 22, 2024
@ashvardanian
Copy link
Owner

There are definitely spots where platform-specific performance tuning can be a great idea. This can be a topic for a proper research project, potentially exposing threshold variables with extern and tuning our sz_find, sz_copy, and other kernels for the target platform. It get's a bit trickier, if the same kernel depends on multiple variables and we are forced to grid-search...

Are you familiar with similar projects, @nordlow?

@nordlow
Copy link
Author

nordlow commented Oct 22, 2024

Unfortunately not.

Thanks for the response anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
@nordlow @ashvardanian and others