Skip to content

Sparse and AVX2 #172

Description

@syzygy1

On my AVX2 laptop, sparse multiplication now turns out to be slower than the non-sparse multiplication. I suspect that this is not the case on some other AVX2 CPUs, in particular Zen 1.

I have therefore added a compilation option.
To compile with sparse multiplication: make -j pgo sparse=yes
To compile without sparse multiplication: make -j pgo sparse=no

By default "sparse=yes" except for AVX2 targets (including BMI2, VNNI, AVX512).

If it is clear that "sparse=no" is still faster on Zen 1 or on other CPUs with AVX2, I can make it the default on those CPUs. I cannot test this myself, so if anyone is willing to try sparse=yes/no on Zen 1 or other CPUs, that would be very welcome.

It would also be interesting to know if sparse=no is faster on any non-AVX2 CPUs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions