The HPVM Compiler Infrastructure
This repository contains the source code and documentation for the HPVM Compiler Infrastructure.
The README briefly describes how to get started with building and installing HPVM. It also provides a benchmark suite to test the compiler infrastructure.
HPVM is currently at version 0.5. For more about what HPVM is, see our website.
Paper
Docs
Dependencies
The following components are required to be installed on your machine to build HPVM.
- GCC (>=5.1.0)
- CMake (>=3.17.0)
- Python (>=2.7)
- GNU Make (>=3.79.1)
- OpenCL (>=1.0.0) or CUDA (>=9.1, only required for GPU support)
Supported Targets
Supported/tested CPU architectures:
- Intel Xeon E5-2640
- Intel Xeon W-2135
- ARM Cortex A-57
Supported/tested GPU architectures:
- Nvidia Quadro P1000
- Nvidia GeForce GTX 1080
HPVM has not been tested but might work on other CPUs supported by LLVM Backend, and GPUs supported by OpenCL such as Intel, AMD, etc.
Getting source code and building HPVM
Checkout HPVM:
git clone https://gitlab.engr.illinois.edu/llvm/hpvm-release.git/
cd hpvm-release/hpvm
Before installing HPVM, some paths must be set for installation to succeed. The following variables in set_paths.sh must be set:
- CUDA_TOOLKIT_PATH --- Path to the CUDA toolkit
- CUDA_INCLUDE_PATH --- Path to the CUDA headers
- CUDA_LIB_PATH -- Path to CUDA libraries
Once the aforementioned variables in set_paths.sh have been specified, run the script.
source set_paths.sh
HPVM installer script can be used to download, configure and build HPVM along with LLVM and Clang.
bash install.sh
Specifically, the HPVM installer downloads LLVM, and Clang, copies HPVM source into llvm/tools and builds the entire tree. It also builds a modified LLVM C-Backend, based on the one maintained by Julia Computing, as a part of HPVM and is currently used to generate OpenCL kernels for GPUs.
In the beginning of the building process, the installer provides users the choice of automatically or manually building HPVM. If HPVM is selected to be built automatically, the installer allows users to type in the number of threads they want to use. The default number of threads used to build HPVM is two.
Alternatively, CMake can be run manually using the following steps in ./hpvm-release/hpvm directory.
mkdir build
cd build
cmake ../llvm [options]
Some common options that can be used with CMake are:
-
-DCMAKE_INSTALL_PREFIX=directory --- Specify for directory the full pathname of where you want the HPVM tools and libraries to be installed.
-
-DCMAKE_BUILD_TYPE=type --- Valid options for type are Debug, Release, RelWithDebInfo, and MinSizeRel. Default is Debug.
-
-DLLVM_ENABLE_ASSERTIONS=On --- Compile with assertion checks enabled (default is Yes for Debug builds, No for all other build types).
In order to manually build and install HPVM, GNU Make can be run using the following in the build directory.
make -j<number of threads>
make install
In the end of the installation process, the installer automatically runs all the regression tests to ensure that the installation is successful. If HPVM is built and installed manually, the tests can be automatically run by executing the following step from the ./hpvm-release/hpvm directory.
bash scripts/automate_tests.sh
With all the aforementioned steps, HPVM should be built, installed, tested and ready to use.
Benchmarks and Tests
We are providing the following HPVM benchmarks:
- Select benchmarks from the Parboil benchmark suite, located under test/benchmarks/parboil.
- An edge detection pipeline benchmark, located under test/benchmarks/pipeline.
- A Camera ISP pipeline, located under test/benchmarks/hpvm-cava, adapted from C code provided from our collaborators at Harvard.
Benchmark descriptions and instructions on how to compile and run them are here.
We are also providing unit tests and regression tests.
Support
All questions can be directed to hpvm-dev@lists.cs.illinois.edu.