CUTLASS 2.4 (Implicit GEMM convolution) (#147)
CUTLASS 2.4 (Implicit GEMM Convolution) Co-authored-by: Manish Gupta <manigupta@nvidia.com>, Haicheng Wu <haichengw@nvidia.com>, Dustyn Blasig <dblasig@nvidia.com>, Andrew Kerr <akerr@nvidia.com>
This commit is contained in:
co-authored by
Manish Gupta <manigupta@nvidia.com>, Haicheng Wu <haichengw@nvidia.com>, Dustyn Blasig <dblasig@nvidia.com>, Andrew Kerr <akerr@nvidia.com>
parent
c2b80ad4e4
commit
6615010cd0
@@ -7,11 +7,15 @@
|
||||
## Prerequisites
|
||||
|
||||
CUTLASS requires:
|
||||
- NVIDIA CUDA Toolkit (9.2 or later required, [11.0](https://developer.nvidia.com/cuda-toolkit) recommended)
|
||||
- NVIDIA CUDA Toolkit (9.2 or later required, [11.1](https://developer.nvidia.com/cuda-toolkit) recommended)
|
||||
- CMake 3.12+
|
||||
- host compiler supporting C++11 or greater (g++ 7.3.0 or Microsoft Visual Studio 2015 recommended)
|
||||
- Python 3.6+
|
||||
|
||||
CUTLASS may be optionally compiled and linked with
|
||||
- cuBLAS
|
||||
- cuDNN v7.6 or later
|
||||
|
||||
## Initial build steps
|
||||
|
||||
Construct a build directory and run CMake.
|
||||
@@ -31,6 +35,23 @@ $ cmake .. -DCUTLASS_NVCC_ARCHS=80 -DCUTLASS_ENABLE_TESTS=OFF -DCUTLASS_UNITY_BU
|
||||
|
||||
This reduces overall compilation time by excluding unit tests and enabling the unit build.
|
||||
|
||||
You may reduce build times by compiling only certain operations by setting the `CUTLASS_LIBRARY_OPERATIONS` flag as shown below,
|
||||
executed from an empty `build/` directory. This only compiles 2-D convolution kernels.
|
||||
|
||||
```bash
|
||||
$ cmake .. -DCUTLASS_NVCC_ARCHS=80 -DCUTLASS_LIBRARY_OPERATIONS=conv2d
|
||||
```
|
||||
|
||||
You may also filter kernels by name by supplying a filter string with flag `CUTLASS_LIBRARY_KERNELS`.
|
||||
|
||||
```bash
|
||||
$ cmake .. -DCUTLASS_NVCC_ARCHS=80 -DCUTLASS_LIBRARY_KERNELS=s16816gemm,s16816fprop*128x128
|
||||
```
|
||||
|
||||
You may explicitly exclude cuBLAS and cuDNN as dependencies with the following CMake flags.
|
||||
- `-DCUTLASS_ENABLE_CUBLAS=OFF`
|
||||
- `-DCUTLASS_ENABLE_CUDNN=OFF`
|
||||
|
||||
|
||||
## Build and run the CUTLASS Profiler
|
||||
|
||||
@@ -39,7 +60,7 @@ From the `build/` directory created above, compile the the CUTLASS Profiler.
|
||||
$ make cutlass_profiler -j12
|
||||
```
|
||||
|
||||
Then execute the CUTLASS Profiler for a set of problem sizes.
|
||||
Then execute the CUTLASS Profiler computing GEMM, execute the following command.
|
||||
```bash
|
||||
$ ./tools/profiler/cutlass_profiler --kernels=sgemm --m=4352 --n=4096 --k=4096
|
||||
|
||||
@@ -66,6 +87,45 @@ $ ./tools/profiler/cutlass_profiler --kernels=sgemm --m=4352 --n=4096 --k=4096
|
||||
Math: 13854.9 GFLOP/s
|
||||
```
|
||||
|
||||
To execute the CUTLASS Profiler for Convolution, run the following example.
|
||||
```bash
|
||||
$ ./tools/profiler/cutlass_profiler --kernels=s1688fprop --n=8 --h=224 --w=224 --c=128 --k=128 --r=3 --s=3 --pad_h=1 --pad_w=1
|
||||
```
|
||||
|
||||
To execute all CUTLASS 2-D convolution operators, execute the following.
|
||||
```bash
|
||||
$ ./tools/profiler/cutlass_profiler --operation=conv2d--n=8 --h=224 --w=224 --c=128 --k=128 --r=3 --s=3
|
||||
|
||||
|
||||
=============================
|
||||
Problem ID: 1
|
||||
|
||||
Provider: CUTLASS
|
||||
OperationKind: conv2d
|
||||
Operation: cutlass_simt_sfprop_optimized_128x128_8x2_nhwc
|
||||
|
||||
Status: Success
|
||||
Verification: ON
|
||||
Disposition: Passed
|
||||
|
||||
reference_device: Passed
|
||||
|
||||
Arguments: --conv_kind=fprop --n=8 --h=224 --w=224 --c=128 --k=128 --r=3 --s=3 --p=224 --q=224 --pad_h=1 --pad_w=1 \
|
||||
--stride_h=1 --stride_w=1 --dilation_h=1 --dilation_w=1 --Activation=f32:nhwc --Filter=f32:nhwc --Output=f32:nhwc \
|
||||
--conv_mode=cross --iterator_algorithm=optimized --alpha=1 --beta=0 --split_k_mode=serial --split_k_slices=1 \
|
||||
--eq_gemm_provider=none --op_class=simt --accum=f32 --cta_m=128 --cta_n=128 --cta_k=8 --stages=2 --warps_m=4 \
|
||||
--warps_n=2 --warps_k=1 --inst_m=1 --inst_n=1 --inst_k=1 --min_cc=50 --max_cc=1024
|
||||
|
||||
Bytes: 2055798784 bytes
|
||||
FLOPs: 118482796544 flops
|
||||
|
||||
Runtime: 8.13237 ms
|
||||
Memory: 235.431 GiB/s
|
||||
|
||||
Math: 14569.3 GFLOP/s
|
||||
|
||||
```
|
||||
|
||||
See [documentation for the CUTLASS Profiler](profiler.md) for more details.
|
||||
|
||||
## Build and run CUTLASS Unit Tests
|
||||
|
||||
Reference in New Issue
Block a user