composable_kernel

composable_kernel for tvm

https://github.com/cydia2018/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 (14.2%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

composable_kernel for tvm

Basic Info
  • Host: GitHub
  • Owner: Cydia2018
  • License: other
  • Language: C++
  • Default Branch: develop
  • Size: 10.5 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog License Citation Support

README.md

Composable Kernel

Methodology

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 languages, like HIP C++.

CK utilizes two concepts to achieve performance portability and code maintainability: * A tile-based programming model * Algorithm complexity reduction for complex ML operators, using innovative technique we call "Tensor Coordinate Transformation".

ALT

Code Structure

Current CK library are structured into 4 layers: * "Templated Tile Operators" layer * "Templated Kernel and Invoker" layer * "Instantiated Kernel and Invoker" layer * "Client API" layer

ALT

Documentation

Run the steps below to build documentation locally.

cd docs pip3 install -r sphinx/requirements.txt python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

Contributors

The list of developers and contributors is here: Contributors

Citation

If you use CK, please use following citations: * CK paper will be freely available on arXiv soon: Realizing Tensor Operators Using Coordinate Transformations and Tile Based Programming * CITATION.cff

License

CK is released under the MIT license. License File

Build CK

Build docker image

bash DOCKER_BUILDKIT=1 docker build -t ck:latest -f Dockerfile . Pre-built dockers are available from this public repo: https://hub.docker.com/r/rocm/composable_kernel/tags

Launch docker

bash docker run \ -it \ --privileged \ --group-add sudo \ -w /root/workspace \ -v ${PATH_TO_LOCAL_WORKSPACE}:/root/workspace \ ck:latest \ /bin/bash

Build CK

```bash mkdir build && cd build

Need to specify target ID, example below is for gfx908 and gfx90a

cmake \ -D CMAKEPREFIXPATH=/opt/rocm \ -D CMAKECXXCOMPILER=/opt/rocm/bin/hipcc \ -D CMAKEBUILDTYPE=Release \ -D GPU_TARGETS="gfx908;gfx90a" \ .. ```

If GPU_TARGETS is not set on the cmake command line, CK will be built for all targets supported by the current compiler.

Additional cmake flags can be used to significantly speed-up the build:

INSTANCES_ONLY (by default is OFF) must be set to ON in order to build only the instances and library while skipping all tests, examples, and profiler. This is useful for libraries that use CK as a dependency.

DTYPES (by default not set) can be set to any subset of "fp64;fp32;fp16;fp8;bf16;int8" to build instances of select data types only. Currently, building of int8 instances is taking a lot of time (the compiler fix is in the works).

DLKERNELS (by default is OFF) must be set to ON in order to build the gemmdl and batchedgemmmultiddl instances. Those instances are only needed for the NAVI2x platforms.

Build examples and tests

bash make -j examples tests make test

Instructions for running each individual examples are under example

Build ckProfiler

bash make -j ckProfiler Instructions for running ckProfiler are under profiler

Install CK

bash make install

Using CK as pre-built kernel library

Instructions for using CK as a pre-built kernel library are under client_example

Contributing

When you contribute to Composable Kernel, make sure to run clang-format on all the 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

This way, pre-commit will add the appropriate hooks to your local repository and automatically run 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 for any reason, you need to temporarily disable precommit hooks, you can add the --no-verify option to the git commit command.

Caveat

Kernel Timing and Verification

CK's own kernel timer will warn up kernel once, and then run it multiple times to get average kernel time. For some kernels that use atomic add, this will cause output buffer to be accumulated multiple times, causing verification failure. To work around it, do not use CK's own timer and do verification at the same time. CK's own timer and verification in each example and ckProfiler can be enabled or disabled from command line.

Owner

  • Login: Cydia2018
  • Kind: user

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/ROCmSoftwarePlatform/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/ROCmSoftwarePlatform/composable_kernel/blob/7fc3ed761aa35709d87c8fbbe41dd368648b3541/LICENSE

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (1)

Dependencies

Dockerfile docker
  • ubuntu 20.04 build
dev-requirements.txt pypi
  • ROCmSoftwarePlatform * development
  • RadeonOpenCompute * development
  • danmar * development
docs/sphinx/requirements.in pypi
  • rocm-docs-core >=0.20.0
  • sphinxcontrib-bibtex ==2.5.0
docs/sphinx/requirements.txt pypi
  • accessible-pygments ==0.0.3
  • alabaster ==0.7.13
  • babel ==2.12.1
  • beautifulsoup4 ==4.11.2
  • breathe ==4.34.0
  • certifi ==2022.12.7
  • cffi ==1.15.1
  • charset-normalizer ==3.1.0
  • click ==8.1.3
  • cryptography ==40.0.2
  • deprecated ==1.2.13
  • docutils ==0.16
  • fastjsonschema ==2.18.0
  • gitdb ==4.0.10
  • gitpython ==3.1.31
  • idna ==3.4
  • imagesize ==1.4.1
  • jinja2 ==3.1.2
  • latexcodec ==2.0.1
  • markdown-it-py ==2.2.0
  • markupsafe ==2.1.2
  • mdit-py-plugins ==0.3.5
  • mdurl ==0.1.2
  • myst-parser ==1.0.0
  • packaging ==23.0
  • pybtex ==0.24.0
  • pybtex-docutils ==1.0.2
  • pycparser ==2.21
  • pydata-sphinx-theme ==0.13.3
  • pygithub ==1.58.2
  • pygments ==2.14.0
  • pyjwt ==2.6.0
  • pynacl ==1.5.0
  • pyyaml ==6.0
  • requests ==2.28.2
  • rocm-docs-core >=0.20.0
  • six ==1.16.0
  • smmap ==5.0.0
  • snowballstemmer ==2.2.0
  • soupsieve ==2.4
  • sphinx ==5.3.0
  • sphinx-book-theme ==1.0.1
  • sphinx-copybutton ==0.5.1
  • sphinx-design ==0.3.0
  • sphinx-external-toc ==0.3.1
  • sphinx-notfound-page ==0.8.3
  • sphinxcontrib-applehelp ==1.0.4
  • sphinxcontrib-bibtex ==2.5.0
  • sphinxcontrib-devhelp ==1.0.2
  • sphinxcontrib-htmlhelp ==2.0.1
  • sphinxcontrib-jsmath ==1.0.1
  • sphinxcontrib-qthelp ==1.0.3
  • sphinxcontrib-serializinghtml ==1.1.5
  • typing-extensions ==4.5.0
  • urllib3 ==1.26.15
  • wrapt ==1.15.0
requirements.txt pypi