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

Add RISC-V clang build #2737

Merged
merged 7 commits into from
Apr 26, 2024
Merged

Conversation

keeranroth
Copy link
Contributor

Description

We add a RISC-V target. We are interested in higher-performance cores, so make sure that the vector extension is in place for this. The functionality is on par with aarch64 cross builds. CI is added as well. We assume that the RISC-V target has vector extensions enabled, and that this is at least 128-bits long. This is in line with RISC-V International guidelines that application class processors have a vector length >= 128-bits

There are some modifications of the toolchain that are required to get vector support up and running. In particular, a newer qemu is required, and this needs to be set up with binfmt support, as the deb package does not automatically setup binfmt.

Changes proposed:

  • Add ability to install LLVM from an upstream repo
  • Pass the architecture to install GNU cross-compilers to apt.sh
  • Add ability to install qemu from a Debian package
  • Add a file for setting up binfmt to run RISC-V binaries without specifying QEMU on the command line
  • Add clang CMake toolchain file for RISC-V
  • Add a CI pipeline for running and testing (under emulation) RISC-V builds using LLVM
  • Allow the architecture string in the PLATFORM variable to be more than 3 characters long, so that we can use riscv64 as the architecture name in the oneDAL build
  • Update openBLAS builds to use RISC-V optimized builds with 128-bit vector length
  • Add a precompile macro TARGET_RISCV64 to identify when the build is targeting RISC-V, in order to target RISC-V specific parts of the code base
  • Add structs, macros and enums, as per the SVE build, so that future commits can target specific micro-architectures more easily, and so that the current build completes for RISC-V
  • Add a cpu_vendor to all builds for riscv64
  • Add lnxriscv64 as a platform to use in the makefile

@keeranroth
Copy link
Contributor Author

Based on top of #2736

.ci/env/apt.sh Outdated Show resolved Hide resolved
.ci/env/apt.sh Show resolved Hide resolved
dev/make/compiler_definitions/clang.ref.riscv64.mk Outdated Show resolved Hide resolved
examples/cmake/setup_examples.cmake Show resolved Hide resolved
@napetrov
Copy link
Contributor

/intelci: run

1 similar comment
@Alexandr-Solovev
Copy link
Contributor

/intelci: run

We add a RISC-V target. We are interested in higher-performance cores,
so make sure that the vector extension is in place for this. The
functionality is on par with aarch64 cross builds. CI is added as well.
We assume that the RISC-V target has vector extensions enabled, and that
this is at least 128-bits long. This is in line with RISC-V
International guidelines that application class processors have a vector
length >= 128-bits

There are some modifications of the toolchain that are required to get
vector support up and running. In particular, a newer qemu is required,
and this needs to be set up with binfmt support, as the deb package does
not automatically setup binfmt.

Changes made:
* Add ability to install LLVM from an upstream repo
* Pass the architecture to install GNU cross-compilers to apt.sh
* Add ability to install qemu from a Debian package
* Add a file for setting up binfmt to run RISC-V binaries without
  specifying QEMU on the command line
* Add clang CMake toolchain file for RISC-V
* Add a CI pipeline for running and testing (under emulation) RISC-V
  builds using LLVM
* Allow the architecture string in the PLATFORM variable to be more than
  3 characters long, so that we can use riscv64 as the architecture name
  in the oneDAL build
* Update openBLAS builds to use RISC-V optimized builds with 128-bit
  vector length
* Add a precompile macro TARGET_RISCV64 to identify when the build is
  targeting RISC-V, in order to target RISC-V specific parts of the code
  base
* Add structs, macros and enums, as per the SVE build, so that future
  commits can target specific micro-architectures more easily, and so
  that the current build completes for RISC-V
* Add a cpu_vendor to all builds for riscv64
* Add lnxriscv64 as a platform to use in the makefile
@Alexandr-Solovev
Copy link
Contributor

/intelci: run

@keeranroth
Copy link
Contributor Author

@Alexandr-Solovev are there some things that need fixing? The public CI is green, and there aren't any outstanding comments

Copy link
Contributor

@napetrov napetrov left a comment

Choose a reason for hiding this comment

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

Private CI - looks as sporadic GPU hang that shouldn't be related. @Alexandr-Solovev - please confirm

@napetrov napetrov merged commit 35f1de1 into oneapi-src:main Apr 26, 2024
17 of 18 checks passed
@keeranroth keeranroth deleted the dev/keeranr/rv64-build branch May 2, 2024 11:38
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.

5 participants