rocm-composable_kernel
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: yl8908
- License: other
- Language: C++
- Default Branch: develop
- Size: 47.4 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 0
Metadata Files
README.md
Composable Kernel
[!NOTE] The published documentation is available at Composable Kernel in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the
docsfolder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see Contribute to ROCm documentation.
The Composable Kernel (CK) library provides a programming model for writing performance-critical kernels for machine learning workloads across multiple architectures (GPUs, CPUs, etc.). The CK library uses general purpose kernel languages, such as HIP C++.
CK uses two concepts to achieve performance portability and code maintainability:
- A tile-based programming model
- Algorithm complexity reduction for complex machine learning (ML) operators. This uses an innovative technique called Tensor Coordinate Transformation.

The current CK library is structured into four layers:
- Templated Tile Operators
- Templated Kernel and Invoker
- Instantiated Kernel and Invoker
- Client API

General information
- CK supported operations
- CK Tile supported operations
- CK wrapper
- CK codegen
- CK profiler
- Examples (Custom use of CK supported operations)
- Client examples (Use of CK supported operations with instance factory)
- Terminology
- Contributors
CK is released under the MIT license.
Building CK
We recommend building CK inside Docker containers, which include all necessary packages. Pre-built Docker images are available on DockerHub.
To build a new Docker image, use the Dockerfile provided with the source code:
bash DOCKER_BUILDKIT=1 docker build -t ck:latest -f Dockerfile .Launch the Docker container:
bash docker run \ -it \ --privileged \ --group-add sudo \ -w /root/workspace \ -v ${PATH_TO_LOCAL_WORKSPACE}:/root/workspace \ ck:latest \ /bin/bashClone CK source code from the GitHub repository and start the build:
bash git clone https://github.com/ROCm/composable_kernel.git && \ cd composable_kernel && \ mkdir build && \ cd buildYou must set the
GPU_TARGETSmacro to specify the GPU target architecture(s) you want to run CK on. You can specify single or multiple architectures. If you specify multiple architectures, use a semicolon between each; for example,gfx908;gfx90a;gfx940.bash cmake \ -D CMAKE_PREFIX_PATH=/opt/rocm \ -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \ -D CMAKE_BUILD_TYPE=Release \ -D GPU_TARGETS="gfx908;gfx90a" \ ..If you don't set
GPU_TARGETSon the cmake command line, CK is built for all GPU targets supported by the current compiler (this may take a long time). Tests and examples will only get built if the GPU_TARGETS is set by the user on the cmake command line.NOTE: If you try setting
GPU_TARGETSto a list of architectures, the build will only work if the architectures are similar, e.g.,gfx908;gfx90a, orgfx1100;gfx1101;gfx11012. Otherwise, if you want to build the library for a list of different architectures, you should use theGPU_ARCHSbuild argument, for exampleGPU_ARCHS=gfx908;gfx1030;gfx1100;gfx942.Build the entire CK library:
bash make -jInstall CK:
bash make -j install
Optional post-install steps
Build examples and tests:
bash make -j examples testsBuild and run all examples and tests:
bash make -j checkYou can find instructions for running each individual example in example.
Build and run smoke/regression examples and tests:
bash make -j smoke # tests and examples that run for < 30 seconds eachbash make -j regression # tests and examples that run for >= 30 seconds eachBuild ckProfiler:
bash make -j ckProfilerYou can find instructions for running ckProfiler in profiler.
Build our documentation locally:
bash cd docs pip3 install -r sphinx/requirements.txt python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
Note the -j option for building with multiple threads in parallel, which speeds up the build significantly.
However, -j launches unlimited number of threads, which can cause the build to run out of memory and
crash. On average, you should expect each thread to use ~2Gb of RAM.
Depending on the number of CPU cores and the amount of RAM on your system, you may want to
limit the number of threads. For example, if you have a 128-core CPU and 128 Gb of RAM it's advisable to use -j32.
Additional cmake flags can be used to significantly speed-up the build:
DTYPES(default is not set) can be set to any subset of "fp64;fp32;fp16;fp8;bf16;int8" to build instances of select data types only. The main default data types are fp32 and fp16; you can safely skip other data types.DL_KERNELS(default is OFF) must be set to ON in order to build instances, such asgemm_dlorbatched_gemm_multi_d_dl. These instances are useful on architectures like the NAVI2x, as most other platforms have faster instances, such asxdlorwmma, available.DPP_KERNELS(default is OFF) must be set to ON in order to build instances, such asgemm_dpp. These instances are useful on architectures like the NAVI2x, as most other platforms have faster instances, such asxdlorwmma, available.CK_USE_FP8_ON_UNSUPPORTED_ARCH(default is OFF) must be set to ON in order to build instances, such asgemm_universal,gemm_universal_streamkandgemm_multiply_multiplyfor fp8 data type for GPU targets which do not have native support for fp8 data type, such as gfx908 or gfx90a. These instances are useful on architectures like the MI100/MI200 for the functional support only.
Using sccache for building
The default CK Docker images come with a pre-installed version of sccache, which supports clang being used as hip-compiler (" -x hip"). Using sccache can help reduce the time to re-build code from hours to 1-2 minutes. In order to invoke sccache, you need to run:
bash
sccache --start-server
then add the following flags to the cmake command line:
bash
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache
You may need to clean up the build folder and repeat the cmake and make steps in order to take advantage of the sccache during subsequent builds.
Using CK as pre-built kernel library
You can find instructions for using CK as a pre-built kernel library in client_example.
Contributing to CK
When you contribute to CK, make sure you run clang-format on all changed files. We highly
recommend using git hooks that are managed by the pre-commit framework. To install hooks, run:
bash
sudo script/install_precommit.sh
With this approach, pre-commit adds the appropriate hooks to your local repository and
automatically runs clang-format (and possibly additional checks) before any commit is created.
If you need to uninstall hooks from the repository, you can do so by running the following command:
bash
script/uninstall_precommit.sh
If you need to temporarily disable pre-commit hooks, you can add the --no-verify option to the
git commit command.
Owner
- Login: yl8908
- Kind: user
- Repositories: 1
- Profile: https://github.com/yl8908
Citation (CITATION.cff)
cff-version: 1.2.0
title: Composable Kernel
message: If you use this software, please cite using the following metadata.
type: software
authors:
- given-names: Chao
family-names: Liu
email: chao.liu2@amd.com
affiliation: AMD
- given-names: Jing
family-names: Zhang
email: jing.zhang3@amd.com
affiliation: AMD
- given-names: Letao
family-names: Qin
email: letao.qin@amd.com
affiliation: AMD
- given-names: Qianfeng
family-names: Zhang
email: qianfeng.zhang@amd.com
affiliation: AMD
- given-names: Liang
family-names: Huang
email: carlus.huang@amd.com
affiliation: AMD
- given-names: Shaojie
family-names: Wang
email: shaojie.wang@amd.com
affiliation: AMD
- given-names: Anthony
family-names: Chang
email: antc@amd.com
affiliation: AMD
- given-names: Chunyu
family-names: Lai
email: chunyu.lai@amd.com
affiliation: AMD
- given-names: Illia
family-names: Silin
email: illia.silin@amd.com
affiliation: AMD
- given-names: Adam
family-names: Osewski
email: adam.osewski@amd.com
affiliation: AMD
- given-names: Poyen
family-names: Chen
email: poyen.chen@amd.com
affiliation: AMD
- given-names: Rosty
family-names: Geyyer
email: rosty.geyyer@amd.com
affiliation: AMD
- given-names: Hanwen
family-names: Chen
- given-names: Tejash
family-names: Shah
- given-names: Xiaoyan
family-names: Zhou
- given-names: Jianfeng
family-names: Yan
repository-code: 'https://github.com/ROCm/composable_kernel'
abstract: Composable Kernel (CK) library aims to provide a programming model for writing performance critical kernels for Machine Learning workloads across multiple architectures including GPUs, CPUs, etc, through general purpose kernel progarmming languages, like HIP C++.
keywords:
- 'CK, Composable Kernel, Tensor Coordinate Transformation'
license: MIT
license-url: https://github.com/ROCm/composable_kernel/blob/7fc3ed761aa35709d87c8fbbe41dd368648b3541/LICENSE
GitHub Events
Total
- Delete event: 6
- Issue comment event: 17
- Pull request event: 10
- Create event: 169
Last Year
- Delete event: 6
- Issue comment event: 17
- Pull request event: 10
- Create event: 169
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 6
- Average time to close issues: N/A
- Average time to close pull requests: 15 days
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 2.33
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 6
Past Year
- Issues: 0
- Pull requests: 6
- Average time to close issues: N/A
- Average time to close pull requests: 15 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 2.33
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 6
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (6)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- ubuntu 22.04 build
- ROCm * development
- danmar * development
- rocm-docs-core ==1.13.0
- sphinxcontrib-bibtex ==2.6.3
- accessible-pygments ==0.0.5
- alabaster ==0.7.16
- babel ==2.15.0
- beautifulsoup4 ==4.12.3
- breathe ==4.35.0
- certifi ==2024.7.4
- cffi ==1.16.0
- charset-normalizer ==3.3.2
- click ==8.1.7
- cryptography ==43.0.0
- deprecated ==1.2.14
- docutils ==0.21.2
- fastjsonschema ==2.20.0
- gitdb ==4.0.11
- gitpython ==3.1.43
- idna ==3.7
- imagesize ==1.4.1
- jinja2 ==3.1.4
- latexcodec ==3.0.0
- markdown-it-py ==3.0.0
- markupsafe ==2.1.5
- mdit-py-plugins ==0.4.1
- mdurl ==0.1.2
- myst-parser ==3.0.1
- packaging ==24.1
- pybtex ==0.24.0
- pybtex-docutils ==1.0.3
- pycparser ==2.22
- pydata-sphinx-theme ==0.15.4
- pygithub ==2.3.0
- pygments ==2.18.0
- pyjwt ==2.8.0
- pynacl ==1.5.0
- pyyaml ==6.0.1
- requests ==2.32.3
- rocm-docs-core ==1.13.0
- six ==1.16.0
- smmap ==5.0.1
- snowballstemmer ==2.2.0
- soupsieve ==2.5
- sphinx ==7.4.7
- sphinx-book-theme ==1.1.3
- sphinx-copybutton ==0.5.2
- sphinx-design ==0.6.0
- sphinx-external-toc ==1.0.1
- sphinx-notfound-page ==1.0.3
- sphinxcontrib-applehelp ==2.0.0
- sphinxcontrib-bibtex ==2.6.3
- sphinxcontrib-devhelp ==2.0.0
- sphinxcontrib-htmlhelp ==2.1.0
- sphinxcontrib-jsmath ==1.0.1
- sphinxcontrib-qthelp ==2.0.0
- sphinxcontrib-serializinghtml ==2.0.0
- tomli ==2.0.1
- typing-extensions ==4.12.2
- urllib3 ==2.2.2
- wrapt ==1.16.0