pulp icon indicating copy to clipboard operation
pulp copied to clipboard

Refactor to add more type support

Open wingertge opened this issue 10 months ago • 2 comments

I needed support for 8/16 bit types and min/max for integers, but the changes quickly became unmanageable. So instead I tried reining in the code duplication a bit using some paste macros so it's easier to add more types to existing operations, or add more simple ops. I managed to add a lot of new type support while shrinking code size, and I used cargo-semver-checks to ensure no breaking changes were added.

One thing I'm unsure about are the 8 and 16 bit masked loads - there are several approaches to solving this without AVX-512, but they each have performance tradeoffs. So for the time being, I have them fall back to the scalar implementation on all targets except V4.

wingertge avatar Feb 17 '25 20:02 wingertge

sorry for not responding earlier. this looks pretty interesting and i wanna take some time to get a closer look at it

sarah-quinones avatar Mar 02 '25 22:03 sarah-quinones

sorry for not responding earlier. this looks pretty interesting and i wanna take some time to get a closer look at it

Of course, it is a pretty massive change. So take your time, I can work off a branch for now. I do have a ton of other ops I also need added on another branch and the macros made that so much less painful than having to do it all manually. So while this one only adds a couple of new functions, I had enough time using the macros to verify it eases maintenance burden a lot in the long run.

wingertge avatar Mar 02 '25 22:03 wingertge

sorry for taking so long to get to this. i like the changes a lot

sarah-quinones avatar Sep 11 '25 12:09 sarah-quinones