RE: Proposal for Updating CRC32C with AVX-512 Algorithm.

From: "Amonson, Paul D" <paul(dot)d(dot)amonson(at)intel(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Shankaran, Akash" <akash(dot)shankaran(at)intel(dot)com>
Subject: RE: Proposal for Updating CRC32C with AVX-512 Algorithm.
Date: 2024-08-26 17:09:35
Message-ID: BL1PR11MB5304764B26D3350381D92EF4DC8B2@BL1PR11MB5304.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Upthread [0], Andres suggested dispatching to a different implementation for
> compile-time-known small lengths. Have you looked into that? In your
> original post, you noted a 14% regression for records smaller than 256 bytes,
> which is not an uncommon case for Postgres. IMO we should try to mitigate
> that as much as possible.

Hi,

Ok I added a patch that exposed a new macro CRC32C_COMP_SMALL for targeted fixed size < 256 use cases in Postgres. As for mitigating the regression in general, I have not been able to work up a fallback (i.e. <256 bytes) that doesn't involve runtime checks which cause latency. I also attempted to change the AVX512 fallback from the current algorithm in the avx512 implementation to the SSE original implementation, but I am not seeing any real difference for this use case in performance.

I am open to any other suggestions.

Paul

Attachment Content-Type Size
0001-v3-Refactor-Move-all-HW-checks-to-common-file.patch application/octet-stream 16.3 KB
0002-v3-Feat-Add-support-for-the-SIMD-AVX-512-crc32c-algorit.patch application/octet-stream 40.7 KB
0003-v3-Feat-Targeted-use-of-legacy-crc32c.patch application/octet-stream 13.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-08-26 17:26:27 Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch
Previous Message Robert Haas 2024-08-26 17:03:13 Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch