mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-22 05:48:25 +00:00
* add DeviceGemmXdl * update script * fix naming issue * fix comment * output HostTensorDescriptor * rename * padded GEMM for fwd v4r4r4 nhwc * refactor * refactor * refactor * adding ckProfiler * adding ckProfiler * refactor * fix tuning parameter bug * add more gemm instances * add more fp16 GEMM instances * fix profiler driver * fix bug in tuning parameter * add fp32 gemm instances * small fix * refactor * rename * refactor gemm profiler; adding DeviceConv and conv profiler * refactor * fix * add conv profiler * refactor * adding more GEMM and Conv instance * Create README.md Add build instruction for ckProfiler * Create README.md Add Readme for gemm_xdl example * Update README.md Remove build instruction from top most folder * Update README.md * clean up
57 lines
1.9 KiB
Markdown
57 lines
1.9 KiB
Markdown
# Instructions for ```gemm_xdl``` Example
|
|
|
|
## Docker script
|
|
```bash
|
|
docker run \
|
|
-it \
|
|
--rm \
|
|
--privileged \
|
|
--group-add sudo \
|
|
-w /root/workspace \
|
|
-v ${PATH_TO_LOCAL_WORKSPACE}:/root/workspace \
|
|
rocm/tensorflow:rocm4.3.1-tf2.6-dev \
|
|
/bin/bash
|
|
```
|
|
|
|
## Build ``gemm_xdl```
|
|
```bash
|
|
mkdir build && cd build
|
|
```
|
|
|
|
```bash
|
|
# Need to specify target ID, example below is gfx908
|
|
cmake \
|
|
-D BUILD_DEV=OFF \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_CXX_FLAGS="-DCK_AMD_GPU_GFX908 --amdgpu-target=gfx908 -O3 " \
|
|
-D CMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \
|
|
-D CMAKE_PREFIX_PATH=/opt/rocm \
|
|
..
|
|
```
|
|
|
|
```bash
|
|
make -j gemm_xdl
|
|
```
|
|
|
|
## Run ```gemm_xdl```
|
|
```bash
|
|
#arg1: verification (0=no, 1=yes)
|
|
#arg2: initialization (0=no init, 1=integer value, 2=decimal value)
|
|
#arg3: run kernel # of times (>1)
|
|
./example/gemm_xdl.sh 0 1 5
|
|
```
|
|
|
|
Result (MI100 @ 1087Mhz, 133.5TFlops peak FP16)
|
|
```
|
|
a_m_k: dim 2, lengths {3840, 4096}, strides {4096, 1}
|
|
b_k_n: dim 2, lengths {4096, 4096}, strides {1, 4096}
|
|
c_m_n: dim 2, lengths {3840, 4096}, strides {4096, 1}
|
|
arg.a_grid_desc_k0_m_k1_{512, 3840, 8}
|
|
arg.b_grid_desc_k0_n_k1_{512, 4096, 8}
|
|
arg.c_grid_desc_m_n_{ 3840, 4096}
|
|
launch_and_time_kernel: grid_dim {480, 1, 1}, block_dim {256, 1, 1}
|
|
Warm up
|
|
Start running 5 times...
|
|
Perf: 1.19685 ms, 107.657 TFlops, 78.8501 GB/s
|
|
```
|