- Notifications
You must be signed in to change notification settings - Fork133
The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm
License
ROCm/TheRock
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
TheRock (The HIP Environment and ROCm Kit) is a lightweight open source build platform for HIP and ROCm. The project is currently in anearly preview state but is under active development and welcomes contributors. Come try us out! Please seeCONTRIBUTING.md for more info.
TheRock includes:
- Nightly releases of ROCm and PyTorch
- A CMake super-project for HIP and ROCm source builds
- Support for building PyTorch with ROCm from source
- JAX support and other external project builds are in the works!
- Operating system support including multiple Linux distributions and native Windows
- Tools for developing individual ROCm components
- Comprehensive CI/CD pipelines for building, testing, and releasing supported components
Important
See theReleases Page for instructions on how to install prebuiltROCm and PyTorch packages.
Packages and Python wheels:
| Platform | Prebuilt tarballs and ROCm Python packages | PyTorch Python packages |
|---|---|---|
| Linux | ||
| Windows |
We keep the following instructions for recent, commonly used operating systemversions. Most build failures are due to minor operating system differences independencies and project setup. Refer to theEnvironment Setup Guide for contributedinstructions and configurations for alternatives.
Tip
While building from source offers the greatest flexibility,installing from releases in supportedconfigurations is often faster and easier.
Important
Frequent setup and building problems and their solutions can be found in sectionCommon Issues.
Tip
dvc is used for version control of pre-compiled MIOpen kernels.dvc is not a hard requirement, but it does reduce compile time.snap install --classic dvc can be used to install on Ubuntu.Visit theDVC website for other installation methods.
# Install Ubuntu dependenciessudo apt updatesudo apt install gfortran git ninja-build cmake g++ pkg-config xxd patchelf automake libtool python3-venv python3-dev libegl1-mesa-dev# Clone the repositorygit clone https://github.com/ROCm/TheRock.gitcd TheRock# Init python virtual environment and install python dependenciespython3 -m venv .venv&&source .venv/bin/activatepip install --upgrade pippip install -r requirements.txt# Download submodules and apply patchespython3 ./build_tools/fetch_sources.py# Install python dependencies for submodulespip install -r requirements-external.txt
Important
Seewindows_support.md for setupinstructions on Windows, in particularthe section forinstalling tools.
If the build system is a non-English system. Make sure to switch toutf-8.
chcp65001
# Install dependencies following the Windows support guide# Clone the repositorygit clone https://github.com/ROCm/TheRock.gitcd TheRock# Init python virtual environment and install python dependenciespython -m venv .venv.venv\Scripts\Activate.batpip install --upgrade pippip install -r requirements.txt# Download submodules and apply patches# Note that dvc is used for pulling large filespython ./build_tools/fetch_sources.py# Install python dependencies for submodulespip install -r requirements-external.txt
The build can be customized through cmake feature flags.
-DTHEROCK_AMDGPU_FAMILIES=or
-DTHEROCK_AMDGPU_TARGETS=
Note
Not all family and targets are currently supported.Seetherock_amdgpu_targets.cmake filefor available options.
In case you don't have an existing ROCm/HIP installation from which you can run any of these tools:
| Tool | Platform |
|---|---|
amd-smi | Linux |
rocm-smi | Linux |
rocm_agent_enumerator | Linux |
hipinfo | Windows |
offload-arch | Both |
You can install therocm Python package for any architecture inside a venv and runoffload-arch from there:
python build_tools/setup_venv.py --index-name nightly --index-subdir gfx110X-dgpu --packages rocm .tmpvenv.tmpvenv/bin/offload-archon Linux,.tmpvenv\Scripts\offload-archon Windowsrm -rf .tmpvenv
By default, the project builds everything available. The following group flagsenable/disable selected subsets:
| Group flag | Description |
|---|---|
-DTHEROCK_ENABLE_ALL=OFF | Disables all optional components |
-DTHEROCK_ENABLE_CORE=OFF | Disables all core components |
-DTHEROCK_ENABLE_COMM_LIBS=OFF | Disables all communication libraries |
-DTHEROCK_ENABLE_MATH_LIBS=OFF | Disables all math libraries |
-DTHEROCK_ENABLE_ML_LIBS=OFF | Disables all ML libraries |
-DTHEROCK_ENABLE_PROFILER=OFF | Disables profilers |
-DTHEROCK_ENABLE_DC_TOOLS=OFF | Disables data center tools |
Individual features can be controlled separately (typically in combination with-DTHEROCK_ENABLE_ALL=OFF or-DTHEROCK_RESET_FEATURES=ON to force aminimal build):
| Component flag | Description |
|---|---|
-DTHEROCK_ENABLE_COMPILER=ON | Enables the GPU+host compiler toolchain |
-DTHEROCK_ENABLE_HIPIFY=ON | Enables the hipify tool |
-DTHEROCK_ENABLE_CORE_RUNTIME=ON | Enables the core runtime components and tools |
-DTHEROCK_ENABLE_HIP_RUNTIME=ON | Enables the HIP runtime components |
-DTHEROCK_ENABLE_OCL_RUNTIME=ON | Enables the OpenCL runtime components |
-DTHEROCK_ENABLE_ROCPROFV3=ON | Enables rocprofv3 |
-DTHEROCK_ENABLE_ROCPROFSYS=ON | Enables rocprofiler-systems |
-DTHEROCK_ENABLE_RCCL=ON | Enables RCCL |
-DTHEROCK_ENABLE_PRIM=ON | Enables the PRIM library |
-DTHEROCK_ENABLE_BLAS=ON | Enables the BLAS libraries |
-DTHEROCK_ENABLE_RAND=ON | Enables the RAND libraries |
-DTHEROCK_ENABLE_SOLVER=ON | Enables the SOLVER libraries |
-DTHEROCK_ENABLE_SPARSE=ON | Enables the SPARSE libraries |
-DTHEROCK_ENABLE_MIOPEN=ON | Enables MIOpen |
-DTHEROCK_ENABLE_MIOPEN_PLUGIN=ON | Enables MIOpen_plugin |
-DTHEROCK_ENABLE_HIPDNN=ON | Enables hipDNN |
-DTHEROCK_ENABLE_ROCWMMA=ON | Enables rocWMMA |
-DTHEROCK_ENABLE_RDC=ON | Enables ROCm Data Center Tool (Linux only) |
Tip
Enabling any features will implicitly enable theirminimum dependencies. Somelibraries (like MIOpen) have a number ofoptional dependencies, which mustbe enabled manually if enabling/disabling individual features.
Tip
A report of enabled/disabled features and flags will be printed on everyCMake configure.
By default, components are built from the sources fetched via the submodules.For some components, external sources can be used instead.
| External source settings | Description |
|---|---|
-DTHEROCK_USE_EXTERNAL_COMPOSABLE_KERNEL=OFF | Use external composable-kernel source location |
-DTHEROCK_USE_EXTERNAL_RCCL=OFF | Use external rccl source location |
-DTHEROCK_USE_EXTERNAL_RCCL_TESTS=OFF | Use external rccl-tests source location |
-DTHEROCK_COMPOSABLE_KERNEL_SOURCE_DIR=<PATH> | Path to composable-kernel sources |
-DTHEROCK_RCCL_SOURCE_DIR=<PATH> | Path to rccl sources |
-DTHEROCK_RCCL_TESTS_SOURCE_DIR=<PATH> | Path to rccl-tests sources |
Further flags allow to build components with specific features enabled.
| Other flags | Description |
|---|---|
-DTHEROCK_ENABLE_MPI=OFF | Enables building components with Message Passing Interface (MPI) support |
Note
Building components with MPI support, currently requires MPI to bepre-installed untilissue #1284is resolved.
For workflows that demand frequent rebuilds, it isrecommended to build it with ccache enabled to speed up the build.See instructions in the next section forLinux andWindows.
Otherwise, ROCm/HIP can be configured and build with just the following commands:
cmake -B build -GNinja. -DTHEROCK_AMDGPU_FAMILIES=gfx110X-dgpucmake --build buildTo build with theccache compiler cache:
- You must have a recent ccache (>= 4.11 at the time of writing) that supportsproper caching with the
--offload-compressoption used for compressingAMDGPU device code. export CCACHE_SLOPPINESS=include_file_ctimeto support hard-linking- Proper setup of the
compiler_checkdirective to do safe caching in thepresence of compiler bootstrapping - Set the C/CXX compiler launcher options to cmake appropriately.
Since these options are very fiddly and prone to change over time, we recommendusing the./build_tools/setup_ccache.py script to create a.ccache directoryin the repository root with hard coded configuration suitable for the project.
Example:
# Any shell used to build must eval setup_ccache.py to set environment# variables.eval"$(./build_tools/setup_ccache.py)"cmake -B build -GNinja -DTHEROCK_AMDGPU_FAMILIES=gfx110X-dgpu \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \.cmake --build build
We are still investigating the exact proper options for ccache on Windows anddo not currently recommend that end users enable it.
Project-wide testing can be controlled with the standard CMake-DBUILD_TESTING=ON|OFF flag. This gates both setup of build tests and compilation of installed testing artifacts.
Tests of the integrity of the build are enabled by default and can be runwith ctest:
ctest --test-dir buildTesting functionality on an actual GPU is in progress and will be documentedseparately.
- Contribution Guidelines: Documentation for the process of contributing to this project including a quick pointer to its governance.
- Development Guide: Documentation on how to use TheRock as a daily driver for developing any of its contained ROCm components (i.e. vs interacting with each component build individually).
- Build System: More detailed information about TheRock's build system relevant to people looking to extend TheRock, add components, etc.
- Environment Setup Guide: Comprehensive guide for setting up a build environment, known workarounds, and other operating specific information.
- Git Chores: Procedures for managing the codebase, specifically focused on version control, upstream/downstream, etc.
- Dependencies: Further specifications on ROCm-wide standards for depending on various components.
- Build Containers: Further information about containers used for building TheRock on CI.
- Build Artifacts: Documentation about the outputs of the build system.
- Releases Page: Documentation for how to leverage our build artifacts.
- Roadmap for Support: Documentation for our prioritized roadmap to support AMD GPUs.
About
The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.