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

Configure.cmake: improve RVV1 check #602

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Nov 2, 2024

To test for RVV1 support, we currently run a small program that uses some vector intrinsics from the v0.11.x draft of the RVV standard. The library itself however needs newer intrinsics than the ones that we test for. This can lead to a problem because GCC 13 supports the intrinsics that we test for, but not (all of) the ones we intend to use. In short, the build can fail with GCC 13: #579

This commit changes the detection mechanism. Instead of compiling a program that makes use of the intrinsics, we now just check the two values, __riscv_v and __riscv_v_intrinsic, to ensure that we have version 1.0 of RVV and version 0.12 of the intrinsics. According to the intrinsics spec, https://github.com/riscv-non-isa/rvv-intrinsic-doc, these are the stable versions.

@orlitzky orlitzky mentioned this pull request Nov 2, 2024
To test for the RISC-V vector extension (RVV), we currently run two
small programs -- one for each value of LMUL=1,2 -- that use some
vector intrinsics from the v0.11.x draft of the intrinsics spec. The
library itself however needs newer intrinsics than the ones that we
test for. This can lead to a problem because GCC 13 supports the
intrinsics that we test for, but not (all of) the ones we intend to
use. In short, the build can fail with GCC 13:

  #579

This commit changes the detection mechanism. Instead of compiling a
program that makes use of the intrinsics, we now just check the two
values, __riscv_v and __riscv_v_intrinsic, to ensure that we have
version 1.0 of the vector extension and version 0.12 of the
intrinsics. These should be the stable versions of each.

Note: the "m1" and "m2" checks are now identical because they are both
covered by the official spec.

Fixes #579
@orlitzky orlitzky force-pushed the better-rvv1-detection branch from e82dffb to ca5e8a2 Compare November 5, 2024 03:33
Copy link
Contributor

@ericlove ericlove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for making this fix.

kxxt added a commit to kxxt/archriscv-packages that referenced this pull request Nov 10, 2024
- Only keep the base python-pytorch package, disabling other variants
  that uses mkl, cuda, rocm.
- Backport shibatch/sleef#602 that fixes RVV
  check for gcc 13.
@blapie blapie merged commit 87e73dc into shibatch:master Nov 11, 2024
36 checks passed
@blapie blapie linked an issue Nov 11, 2024 that may be closed by this pull request
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this pull request Nov 13, 2024
- Only keep the base python-pytorch package, disabling other variants
  that uses mkl, cuda, rocm.
- Backport shibatch/sleef#602 that fixes RVV
  check for gcc 13.
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

Successfully merging this pull request may close these issues.

Risc V and gcc-13
3 participants