diff --git a/docs/index.rst b/docs/index.rst index 5eae912494..2538269a25 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,9 +17,9 @@ The Composable Kernel project is located in https://github.com/ROCm/rocm-librari .. grid-item-card:: Install - * :doc:`Composable Kernel prerequisites <./install/Composable-Kernel-prerequisites>` - * :doc:`Build and install Composable Kernel <./install/Composable-Kernel-install>` - * :doc:`Build and install Composable Kernel on a Docker image <./install/Composable-Kernel-Docker>` + * :doc:`Install Composable Kernel <./install/Composable-Kernel-install>` + * :doc:`Build from source <./install/Composable-Kernel-build>` + * :doc:`Composable Kernel Docker images <./install/Composable-Kernel-Docker>` .. grid-item-card:: Conceptual diff --git a/docs/install/Composable-Kernel-build.rst b/docs/install/Composable-Kernel-build.rst new file mode 100644 index 0000000000..c6fb0d2fa1 --- /dev/null +++ b/docs/install/Composable-Kernel-build.rst @@ -0,0 +1,123 @@ +.. meta:: + :description: Composable Kernel build and install + :keywords: composable kernel, CK, ROCm, API, documentation, install + +*********************************************** +Build and install Composable Kernel from source +*********************************************** + +To build Composable Kernel as part of the ROCm Core SDK, see `TheRock build +instructions +`__. +TheRock is the recommended way to build ROCm components from source. + +Alternatively, you can build Composable Kernel standalone using the following +instructions. + +Prerequisites +============= + +The following prerequisites are required to build and install Composable Kernel: + +* cmake +* hip-rocclr +* iputils-ping +* jq +* libelf-dev +* libncurses5-dev +* libnuma-dev +* libpthread-stubs0-dev +* llvm-amdgpu +* mpich +* net-tools +* python3 +* python3-dev +* python3-pip +* redis +* rocm-llvm-dev +* zlib1g-dev +* libzstd-dev +* openssh-server +* clang-format-18 + +Docker images that include all the required prerequisites for building Composable Kernel are available on `Docker Hub `_. + +Build and install +================= + +Before you begin, clone the `Composable Kernel project `_. + +Use sparse checkout when cloning the Composable Kernel project: + +.. code-block:: bash + + git clone --no-checkout --filter=blob:none https://github.com/ROCm/rocm-libraries.git + cd rocm-libraries + git sparse-checkout init --cone + git sparse-checkout set projects/composablekernel + +Then use ``git checkout`` to check out the branch you need. + +The develop branch is intended for users who want to preview new features or contribute to the Composable Kernel codebase. + +If you don't intend to contribute to the codebase and won't be previewing features, use a branch that matches the version of ROCm installed on your system. + +Create the ``build`` directory under ``rocm-libraries/projects/composablekernel``: + +.. code-block:: bash + + cd projects/composablekernel + mkdir build + +Change directory to the ``build`` directory and generate the makefile using the ``cmake`` command. Two build options are required: + +* ``CMAKE_PREFIX_PATH``: The ROCm installation path. ROCm is installed in ``/opt/rocm`` by default. +* ``CMAKE_CXX_COMPILER``: The path to the Clang compiler. Clang is found at ``/opt/rocm/llvm/bin/clang++`` by default. + +.. code-block:: bash + + cd build + cmake ../. -D CMAKE_PREFIX_PATH="/opt/rocm" -D CMAKE_CXX_COMPILER="/opt/rocm/llvm/bin/clang++" [-D [-D] ...] + +Other build options are: + +* ``DISABLE_DL_KERNELS``: Set this to "ON" to not build deep learning (DL) and data parallel primitive (DPP) instances. + + .. note:: + + DL and DPP instances are useful on architectures that don't support XDL or WMMA. + +* ``CK_USE_FP8_ON_UNSUPPORTED_ARCH``: Set to ``ON`` to build FP8 data type instances on gfx90a without native FP8 support. +* ``GPU_TARGETS``: Target architectures. Target architectures in this list must all be different versions of the same architectures. Enclose the list of targets in quotation marks. Separate multiple targets with semicolons (``;``). For example, ``cmake -D GPU_TARGETS="gfx908;gfx90a"``. This option is required to build tests and examples. +* ``GPU_ARCHS``: Target architectures. Target architectures in this list are not limited to different versions of the same architectures. Enclose the list of targets in quotation marks. Separate multiple targets with semicolons (``;``). For example, ``cmake -D GPU_TARGETS="gfx908;gfx1100"``. +* ``CMAKE_BUILD_TYPE``: The build type. Can be ``None``, ``Release``, ``Debug``, ``RelWithDebInfo``, or ``MinSizeRel``. CMake will use ``Release`` by default. + +.. note:: + + If neither ``GPU_TARGETS`` nor ``GPU_ARCHS`` is specified, Composable Kernel will be built for all targets supported by the compiler. + +Build Composable Kernel using the generated makefile. This will build the library, the examples, and the tests, and save them to ``bin``. + +.. code-block:: bash + + make -j20 + +The ``-j`` option speeds up the build by using multiple threads in parallel. For example, ``-j20`` uses twenty threads in parallel. On average, each thread will use 2GB of memory. Make sure that the number of threads you use doesn't exceed the available memory in your system. + +Using ``-j`` alone will launch an unlimited number of threads and is not recommended. + +Install the Composable Kernel library: + +.. code-block:: bash + + make install + +After running ``make install``, the Composable Kernel files will be saved to the following locations: + +* Library files: ``/opt/rocm/lib/`` +* Header files: ``/opt/rocm/include/ck/`` and ``/opt/rocm/include/ck_tile/`` +* Examples, tests, and ckProfiler: ``/opt/rocm/bin/`` + +For information about ckProfiler, see `the ckProfiler readme file `_. + +For information about running the examples and tests, see :doc:`Composable Kernel examples and tests <../tutorial/Composable-Kernel-examples>`. diff --git a/docs/install/Composable-Kernel-install.rst b/docs/install/Composable-Kernel-install.rst index 243f607b35..7bbf5867c0 100644 --- a/docs/install/Composable-Kernel-install.rst +++ b/docs/install/Composable-Kernel-install.rst @@ -1,88 +1,90 @@ -.. meta:: - :description: Composable Kernel build and install - :keywords: composable kernel, CK, ROCm, API, documentation, install - -****************************************************** -Building and installing Composable Kernel with CMake -****************************************************** - -Before you begin, clone the `Composable Kernel project `_. - -Use sparse checkout when cloning the Composable Kernel project: - -.. code:: - - git clone --no-checkout --filter=blob:none https://github.com/ROCm/rocm-libraries.git - cd rocm-libraries - git sparse-checkout init --cone - git sparse-checkout set projects/composablekernel - -Then use ``git checkout`` to check out the branch you need. - -The develop branch is intended for users who want to preview new features or contribute to the Composable Kernel codebase. - -If you don't intend to contribute to the codebase and won't be previewing features, use a branch that matches the version of ROCm installed on your system. - -Create the ``build`` directory under ``rocm-libraries/projects/composablekernel``: - -.. code:: shell - - cd projects/composablekernel - mkdir build - -Change directory to the ``build`` directory and generate the makefile using the ``cmake`` command. Two build options are required: - -* ``CMAKE_PREFIX_PATH``: The ROCm installation path. ROCm is installed in ``/opt/rocm`` by default. -* ``CMAKE_CXX_COMPILER``: The path to the Clang compiler. Clang is found at ``/opt/rocm/llvm/bin/clang++`` by default. - -.. code:: shell - - cd build - cmake ../. -D CMAKE_PREFIX_PATH="/opt/rocm" -D CMAKE_CXX_COMPILER="/opt/rocm/llvm/bin/clang++" [-D [-D] ...] - - -Other build options are: - -* ``DISABLE_DL_KERNELS``: Set this to "ON" to not build deep learning (DL) and data parallel primitive (DPP) instances. - - .. note:: - - DL and DPP instances are useful on architectures that don't support XDL or WMMA. - -* ``CK_USE_FP8_ON_UNSUPPORTED_ARCH``: Set to ``ON`` to build FP8 data type instances on gfx90a without native FP8 support. -* ``GPU_TARGETS``: Target architectures. Target architectures in this list must all be different versions of the same architectures. Enclose the list of targets in quotation marks. Separate multiple targets with semicolons (``;``). For example, ``cmake -D GPU_TARGETS="gfx908;gfx90a"``. This option is required to build tests and examples. -* ``GPU_ARCHS``: Target architectures. Target architectures in this list are not limited to different versions of the same architectures. Enclose the list of targets in quotation marks. Separate multiple targets with semicolons (``;``). For example, ``cmake -D GPU_TARGETS="gfx908;gfx1100"``. -* ``CMAKE_BUILD_TYPE``: The build type. Can be ``None``, ``Release``, ``Debug``, ``RelWithDebInfo``, or ``MinSizeRel``. CMake will use ``Release`` by default. - -.. Note:: - - If neither ``GPU_TARGETS`` nor ``GPU_ARCHS`` is specified, Composable Kernel will be built for all targets supported by the compiler. - -Build Composable Kernel using the generated makefile. This will build the library, the examples, and the tests, and save them to ``bin``. - -.. code:: shell - - make -j20 - -The ``-j`` option speeds up the build by using multiple threads in parallel. For example, ``-j20`` uses twenty threads in parallel. On average, each thread will use 2GB of memory. Make sure that the number of threads you use doesn't exceed the available memory in your system. - -Using ``-j`` alone will launch an unlimited number of threads and is not recommended. - -Install the Composable Kernel library: - -.. code:: shell - - make install - -After running ``make install``, the Composable Kernel files will be saved to the following locations: - -* Library files: ``/opt/rocm/lib/`` -* Header files: ``/opt/rocm/include/ck/`` and ``/opt/rocm/include/ck_tile/`` -* Examples, tests, and ckProfiler: ``/opt/rocm/bin/`` - -For information about ckProfiler, see `the ckProfiler readme file `_. - -For information about running the examples and tests, see :doc:`Composable Kernel examples and tests <../tutorial/Composable-Kernel-examples>`. - - - +.. meta:: + :description: Installation instructions for Composable Kernel + :keywords: ck, lib, composable, kernel, algorithm, install, sdk, rocm + +.. _installation: + +************************* +Install Composable Kernel +************************* + +Before you begin, verify that your system is supported. For more information, +see :ref:`ROCm Core SDK components `. + +For advanced workflows, source builds, or custom configurations, see +:doc:`./Composable-Kernel-build`. + +.. _install-rocm: + +Install the ROCm Core SDK +========================= + +Composable Kernel (CK) is included with the ROCm Core SDK on Linux and Windows. +For the most complete installation, we recommend that developers use the +``amdrocm-core-sdk`` meta package on Linux. + +For instructions, see :doc:`Install AMD ROCm `. Use the +selector panel on that page to view instructions appropriate for your system +environment. + +.. _install-base: + +Install the ROCm CK package on Linux +==================================== + +Alternatively, if you want to install Composable Kernel as part of the ROCm +without additional ROCm libraries and tools, install the ``amdrocm-ck`` +package. + +1. Complete the :doc:`ROCm installation prerequisites ` to + install dependencies and configure GPU access permissions. + +2. Install the ROCm CK package that matches your desired ROCm version. Package + names use the following format: + + .. code-block:: shell-session + + amdrocm-ck- + + Where: + + * ```` is the ROCm Core SDK version to install. Omit this + suffix to install the latest available version. + + * ```` (starting with ``gfx``) is used if you are installing + for a single AMD GPU architecture. Omit this suffix to install for all + architectures at the cost of disk space. + + For example, to install the latest Composable Kernel development package release for + supported GPU architectures: + + .. tab-set:: + + .. tab-item:: Debian-based distros + + .. code-block:: bash + + sudo apt install amdrocm-ck + + .. tab-item:: RHEL-based distros + + .. code-block:: bash + + sudo dnf install amdrocm-ck + + .. tab-item:: SLES + + .. code-block:: bash + + sudo zypper install amdrocm-ck + +.. _install-nightly: + +Install a nightly build +======================= + +The `TheRock `__ build system also publishes +nightly builds for the ROCm Core SDK and its components, including Composable +Kernel. See `Nightly release status +`__ for details. + diff --git a/docs/install/Composable-Kernel-prerequisites.rst b/docs/install/Composable-Kernel-prerequisites.rst deleted file mode 100644 index 9dc082599a..0000000000 --- a/docs/install/Composable-Kernel-prerequisites.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. meta:: - :description: Composable Kernel prerequisites - :keywords: composable kernel, CK, ROCm, API, documentation, prerequisites - -****************************************************** -Composable Kernel prerequisites -****************************************************** - -Docker images that include all the required prerequisites for building Composable Kernel are available on `Docker Hub `_. - -The following prerequisites are required to build and install Composable Kernel: - -* cmake -* hip-rocclr -* iputils-ping -* jq -* libelf-dev -* libncurses5-dev -* libnuma-dev -* libpthread-stubs0-dev -* llvm-amdgpu -* mpich -* net-tools -* python3 -* python3-dev -* python3-pip -* redis -* rocm-llvm-dev -* zlib1g-dev -* libzstd-dev -* openssh-server -* clang-format-18 diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index a74b8cd363..d5140261b9 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -5,10 +5,10 @@ subtrees: - caption: Install entries: - - file: install/Composable-Kernel-prerequisites.rst - title: Prerequisites - file: install/Composable-Kernel-install.rst - title: Build and install Composable Kernel + title: Install Composable Kernel + - file: install/Composable-Kernel-build.rst + title: Build from source - file: install/Composable-Kernel-Docker.rst title: Docker images