dockerhub.rst 3.84 KB
Newer Older
pmaybank's avatar
pmaybank committed
1
===================
2
CK Docker Hub
pmaybank's avatar
pmaybank committed
3
4
5
6
7
8
===================

-------------------------------------
Why do I need this?
-------------------------------------

9
10
To make our lives easier and bring Composable Kernel dependencies together, we recommend using
docker images that can be found on `Docker Hub <https://hub.docker.com/r/rocm/composable_kernel>`_.
pmaybank's avatar
pmaybank committed
11
12
13
14
15

-------------------------------------
So what is Composable Kernel?
-------------------------------------

16
17
18
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++.
pmaybank's avatar
pmaybank committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32

To get the CK library::

    git clone https://github.com/ROCmSoftwarePlatform/composable_kernel.git


run a docker container::

    docker run                                                            \
    -it                                                                   \
    --privileged                                                          \
    --group-add sudo                                                      \
    -w /root/workspace                                                    \
    -v ${PATH_TO_LOCAL_WORKSPACE}:/root/workspace                         \
33
    rocm/composable_kernel:ck_ub20.04_rocm6.0                             \
pmaybank's avatar
pmaybank committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    /bin/bash

and build the CK::

    mkdir build && cd build
    # Need to specify target ID, example below is for gfx908 and gfx90a
    cmake                                                                                             \
    -D CMAKE_PREFIX_PATH=/opt/rocm                                                                    \
    -D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc                                                         \
    -D CMAKE_CXX_FLAGS="-O3"                                                                          \
    -D CMAKE_BUILD_TYPE=Release                                                                       \
    -D GPU_TARGETS="gfx908;gfx90a"                                                                    \
    ..

and::

    make -j examples tests

To run all the test cases including tests and examples run::

    make test

We can also run specific examples or tests like::

    ./bin/example_gemm_xdl_fp16
    ./bin/test_gemm_fp16

61
62
63
For more details visit `CK github repository <https://github.com/ROCmSoftwarePlatform/composable_kernel>`_,
`CK examples <https://github.com/ROCmSoftwarePlatform/composable_kernel/tree/develop/example)>`_,
`even more CK examples <https://github.com/ROCmSoftwarePlatform/composable_kernel/tree/develop/client_example>`_.
pmaybank's avatar
pmaybank committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

-------------------------------------
And what is inside?
-------------------------------------

The docker images have everything you need for running CK including:

* `ROCm <https://www.amd.com/en/graphics/servers-solutions-rocm>`_
* `CMake <https://cmake.org/>`_
* `Compiler <https://github.com/RadeonOpenCompute/llvm-project>`_

-------------------------------------
Which image is right for me?
-------------------------------------

79
Let's take a look at the image naming, for example ``ck_ub20.04_rocm6.0``. The image specs are:
pmaybank's avatar
pmaybank committed
80

81
82
* ``ck`` - made for running Composable Kernel;
* ``ub20.04`` - based on Ubuntu 20.04;
83
* ``rocm6.0`` - ROCm platform version 6.0.
pmaybank's avatar
pmaybank committed
84
85
86
87
88
89
90

So just pick the right image for your project dependencies and you're all set.

-------------------------------------
DIY starts here
-------------------------------------

91
92
93
If you need to customize a docker image or just can't stop tinkering, feel free to adjust the
`Dockerfile <https://github.com/ROCmSoftwarePlatform/composable_kernel/blob/develop/Dockerfile>`_
for your needs.
pmaybank's avatar
pmaybank committed
94
95
96
97
98
99

-------------------------------------
License
-------------------------------------

CK is released under the MIT `license <https://github.com/ROCmSoftwarePlatform/composable_kernel/blob/develop/LICENSE>`_.