Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm

License

NotificationsYou must be signed in to change notification settings

ROCm/TheRock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pre-commitCICI Nightly

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.

Features

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

Installing from releases

Important

See theReleases Page for instructions on how to install prebuiltROCm and PyTorch packages.

Nightly release status

Packages and Python wheels:

PlatformPrebuilt tarballs and ROCm Python packagesPyTorch Python packages
LinuxRelease portable Linux packagesRelease Portable Linux PyTorch Wheels
WindowsRelease Windows packagesRelease Windows PyTorch Wheels

Building from source

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.

Setup - Ubuntu (24.04)

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

Setup - Windows 11 (VS 2022)

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

Build configuration

The build can be customized through cmake feature flags.

Required configuration flags

  • -DTHEROCK_AMDGPU_FAMILIES=

    or

  • -DTHEROCK_AMDGPU_TARGETS=

Note

Not all family and targets are currently supported.Seetherock_amdgpu_targets.cmake filefor available options.

Discovering available targets on your system

In case you don't have an existing ROCm/HIP installation from which you can run any of these tools:

ToolPlatform
amd-smiLinux
rocm-smiLinux
rocm_agent_enumeratorLinux
hipinfoWindows
offload-archBoth

You can install therocm Python package for any architecture inside a venv and runoffload-arch from there:

  1. python build_tools/setup_venv.py --index-name nightly --index-subdir gfx110X-dgpu --packages rocm .tmpvenv
  2. .tmpvenv/bin/offload-arch on Linux,.tmpvenv\Scripts\offload-arch on Windows
  3. rm -rf .tmpvenv

Optional configuration flags

By default, the project builds everything available. The following group flagsenable/disable selected subsets:

Group flagDescription
-DTHEROCK_ENABLE_ALL=OFFDisables all optional components
-DTHEROCK_ENABLE_CORE=OFFDisables all core components
-DTHEROCK_ENABLE_COMM_LIBS=OFFDisables all communication libraries
-DTHEROCK_ENABLE_MATH_LIBS=OFFDisables all math libraries
-DTHEROCK_ENABLE_ML_LIBS=OFFDisables all ML libraries
-DTHEROCK_ENABLE_PROFILER=OFFDisables profilers
-DTHEROCK_ENABLE_DC_TOOLS=OFFDisables 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 flagDescription
-DTHEROCK_ENABLE_COMPILER=ONEnables the GPU+host compiler toolchain
-DTHEROCK_ENABLE_HIPIFY=ONEnables the hipify tool
-DTHEROCK_ENABLE_CORE_RUNTIME=ONEnables the core runtime components and tools
-DTHEROCK_ENABLE_HIP_RUNTIME=ONEnables the HIP runtime components
-DTHEROCK_ENABLE_OCL_RUNTIME=ONEnables the OpenCL runtime components
-DTHEROCK_ENABLE_ROCPROFV3=ONEnables rocprofv3
-DTHEROCK_ENABLE_ROCPROFSYS=ONEnables rocprofiler-systems
-DTHEROCK_ENABLE_RCCL=ONEnables RCCL
-DTHEROCK_ENABLE_PRIM=ONEnables the PRIM library
-DTHEROCK_ENABLE_BLAS=ONEnables the BLAS libraries
-DTHEROCK_ENABLE_RAND=ONEnables the RAND libraries
-DTHEROCK_ENABLE_SOLVER=ONEnables the SOLVER libraries
-DTHEROCK_ENABLE_SPARSE=ONEnables the SPARSE libraries
-DTHEROCK_ENABLE_MIOPEN=ONEnables MIOpen
-DTHEROCK_ENABLE_MIOPEN_PLUGIN=ONEnables MIOpen_plugin
-DTHEROCK_ENABLE_HIPDNN=ONEnables hipDNN
-DTHEROCK_ENABLE_ROCWMMA=ONEnables rocWMMA
-DTHEROCK_ENABLE_RDC=ONEnables 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 settingsDescription
-DTHEROCK_USE_EXTERNAL_COMPOSABLE_KERNEL=OFFUse external composable-kernel source location
-DTHEROCK_USE_EXTERNAL_RCCL=OFFUse external rccl source location
-DTHEROCK_USE_EXTERNAL_RCCL_TESTS=OFFUse 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 flagsDescription
-DTHEROCK_ENABLE_MPI=OFFEnables building components with Message Passing Interface (MPI) support

Note

Building components with MPI support, currently requires MPI to bepre-installed untilissue #1284is resolved.

CMake build usage

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 build

CCache usage on Linux

To build with theccache compiler cache:

  • You must have a recent ccache (>= 4.11 at the time of writing) that supportsproper caching with the--offload-compress option used for compressingAMDGPU device code.
  • export CCACHE_SLOPPINESS=include_file_ctime to support hard-linking
  • Proper setup of thecompiler_check directive 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

CCache usage on Windows

We are still investigating the exact proper options for ccache on Windows anddo not currently recommend that end users enable it.

Running tests

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 build

Testing functionality on an actual GPU is in progress and will be documentedseparately.

Development manuals

  • 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

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp