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

porting @Microsoft SPTAG (with native aliases enabled): missing __mmask32 __mmask64 _mm512_setzero_ps _mm512_cvtepi32_ps _mm512_extractf32x8_ps _mm512_cmpgt_epi16_mask #961

Closed
7 tasks done
pabs3 opened this issue Jul 12, 2022 · 17 comments
Assignees

Comments

@pabs3
Copy link

pabs3 commented Jul 12, 2022

While porting @microsoft SPTAG to use SIMDe (with native aliases enabled), I found that there are several missing functions/definitions. As suggested in the README.md I am reporting them here for prioritisation. There are some missing native aliases and missing variants of existing functions:

  • simde_ variants defined but not native aliases
    • __mmask32
    • __mmask64
    • _mm512_setzero_ps
  • _mm512_cvtepi32_ps: missing but _mm512_cvtepu32_ps exists
  • _mm512_extractf32x8_ps: missing but _mm512_extractf32x4_ps exists
  • _mm512_cmpgt_epi16_mask: missing but _mm512_cmpgt_epi8_mask exists

I need the native aliases because @microsoft requires signing a CLA, so I won't be submitting a pull request, so I want my patch to be relatively compatible with any changes that are made upstream to the intrinsics.

pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 12, 2022
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 18, 2022
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 26, 2022
@bastien-roucaries
Copy link

Hi we need it for debian side packaging...

@mr-c
Copy link
Collaborator

mr-c commented Sep 5, 2022

Thanks for the report. There is a guide to adding new instructions at https://github.com/simd-everywhere/simde/wiki/Implementing-a-New-Function

pabs3 added a commit to pabs3/SPTAG that referenced this issue Nov 13, 2022
pabs3 added a commit to pabs3/SPTAG that referenced this issue Feb 5, 2023
@pabs3
Copy link
Author

pabs3 commented Feb 5, 2023

Update: _mm512_setzero_ps now exists since commit c900d5e

pabs3 added a commit to pabs3/SPTAG that referenced this issue Mar 1, 2023
@bastien-roucaries
Copy link

ping ?

@mr-c
Copy link
Collaborator

mr-c commented Mar 20, 2023

Hello @bastien-roucaries There is a guide to adding new instructions at https://github.com/simd-everywhere/simde/wiki/Implementing-a-New-Function

Please let me know if you want assistance with working on this issue, I would be happy to help!

pabs3 added a commit to pabs3/SPTAG that referenced this issue Mar 25, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Apr 1, 2023
@mr-c
Copy link
Collaborator

mr-c commented Apr 29, 2023

@pabs3 Did you see that simde__mmask32, simde__mmask64, and simde_mm512_setzero_ps are implemented?

@mr-c mr-c self-assigned this Apr 29, 2023
@mr-c mr-c closed this as completed in bf1fbae Apr 29, 2023
@pabs3
Copy link
Author

pabs3 commented Apr 29, 2023

@mr-c this issue isn't fully completed because the native aliases __mmask32 and __mmask64 don't exist.
I note that the __mmask8 and __mmask16 native aliases do exist though.

Thanks for implementing _mm512_cvtepi32_ps, _mm512_extractf32x8_ps, _mm512_cmpgt_epi16_mask in commit bf1fbae
and thanks to @EleonoreMizo for adding _mm512_setzero_ps in commit c900d5e.

@mr-c mr-c reopened this Apr 29, 2023
@mr-c
Copy link
Collaborator

mr-c commented Apr 29, 2023

@mr-c this issue isn't fully completed because the native aliases __mmask32 and __mmask64 don't exist.
I note that the __mmask8 and __mmask16 native aliases do exist though.

Whoops I misunderstood. Did you see the note about those types in

/* These are really part of AVX-512VL / AVX-512BW (in GCC __mmask32 is
* in avx512vlintrin.h and __mmask64 is in avx512bwintrin.h, in clang
* both are in avx512bwintrin.h), not AVX-512F. However, we don't have
* a good (not-compiler-specific) way to detect if these headers have
* been included. In compilers which support AVX-512F but not
* AVX-512BW/VL (e.g., GCC 4.9) we need typedefs since __mmask{32,64)
* won't exist.
*
* AFAICT __mmask{32,64} are always just typedefs to uint{32,64}_t
* in all compilers, so it's safe to use these instead of typedefs to
* __mmask{16,32}. If you run into a problem with this please file an
* issue and we'll try to figure out a work-around. */
typedef uint32_t simde__mmask32;
typedef uint64_t simde__mmask64;

If there is a specific compiler version / architecture combination that you are using, and for which you need the native types defined, I think that would be straightforward to add

@pabs3
Copy link
Author

pabs3 commented Apr 29, 2023

I did see that note, it sounds complicated.

When I was testing this I was on Debian bookworm amd64 with GCC 12. My intention was to enable porting SPTAG from amd64 to all of the Debian architectures, probably starting with arm64. Since bookworm is in the freeze, this will likely be something for trixie.

In that situation #define __mmask32 simde__mmask32 was enough to workaround __mmask32 being missing. Likewise for __mmask64. See the link to the SPTAG patch above.

PS: since you are the Debian maintainer of simde too, an upload to Debian experimental would be appreciated so I can work on this further.

@mr-c
Copy link
Collaborator

mr-c commented Apr 30, 2023

Sure, I can upload https://github.com/simd-everywhere/simde/releases/tag/v0.7.4-rc3 to Debian experimental, but it won't have all of the new functions you need; however you could copy them from bf1fbae

@pabs3
Copy link
Author

pabs3 commented May 1, 2023 via email

pabs3 added a commit to pabs3/SPTAG that referenced this issue May 3, 2023
@mr-c
Copy link
Collaborator

mr-c commented May 4, 2023

@mr-c mr-c closed this as completed May 4, 2023
@pabs3
Copy link
Author

pabs3 commented May 4, 2023 via email

@mr-c
Copy link
Collaborator

mr-c commented May 4, 2023

@pabs3 I'm testing d850b83 to provide __mask32 and __mask64 now

@mr-c
Copy link
Collaborator

mr-c commented May 4, 2023

@pabs3 d850b83 has been merged! It'll be in the next rc snapshot (perhaps that will be the real release of 0.7.4 ??)

@mr-c
Copy link
Collaborator

mr-c commented May 5, 2023

@pabs3 whoops, that was my mistake; I've queued up a fix

pabs3 added a commit to pabs3/SPTAG that referenced this issue May 10, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue May 10, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue May 10, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue May 11, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue May 11, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue May 11, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue May 11, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 16, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 16, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 16, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 16, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 16, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 25, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 25, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 25, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 25, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 27, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 27, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 27, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jun 27, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 20, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 20, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 20, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 20, 2023
pabs3 added a commit to pabs3/SPTAG that referenced this issue Jul 20, 2023
dbussink pushed a commit to planetscale/SPTAG that referenced this issue Mar 13, 2024
dbussink pushed a commit to planetscale/SPTAG that referenced this issue Mar 14, 2024
dbussink pushed a commit to planetscale/SPTAG that referenced this issue Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants