(
manifest,
layout,
tile_descriptions,
data_type,
alignment,
conv_kinds=[ConvKind.Fprop, ConvKind.Dgrad, ConvKind.Wgrad],
epilogue_functor=EpilogueFunctor.LinearCombination,
)
| 105 | ########################################################################################################### |
| 106 | # Convolution for 2D operations |
| 107 | def CreateConv2dOperator( |
| 108 | manifest, |
| 109 | layout, |
| 110 | tile_descriptions, |
| 111 | data_type, |
| 112 | alignment, |
| 113 | conv_kinds=[ConvKind.Fprop, ConvKind.Dgrad, ConvKind.Wgrad], |
| 114 | epilogue_functor=EpilogueFunctor.LinearCombination, |
| 115 | ): |
| 116 | |
| 117 | element_a, element_b, element_c, element_epilogue = data_type |
| 118 | |
| 119 | # one exceptional case |
| 120 | alignment_c = min(8, alignment) |
| 121 | |
| 122 | # iterator algorithm (analytic and optimized) |
| 123 | iterator_algorithms = [IteratorAlgorithm.Analytic, IteratorAlgorithm.Optimized] |
| 124 | |
| 125 | # by default, only generate the largest tile size |
| 126 | if manifest.args.kernels == "": |
| 127 | tile_descriptions = [tile_descriptions[0]] |
| 128 | |
| 129 | operations = [] |
| 130 | |
| 131 | for tile in tile_descriptions: |
| 132 | for conv_kind in conv_kinds: |
| 133 | for iterator_algorithm in iterator_algorithms: |
| 134 | A = TensorDescription(element_a, layout[0], alignment) |
| 135 | B = TensorDescription(element_b, layout[1], alignment) |
| 136 | C = TensorDescription(element_c, layout[2], alignment_c) |
| 137 | |
| 138 | # unity stride only for Optimized Dgrad |
| 139 | if (iterator_algorithm == IteratorAlgorithm.Optimized) and ( |
| 140 | conv_kind == ConvKind.Dgrad |
| 141 | ): |
| 142 | new_operation = Conv2dOperation( |
| 143 | conv_kind, |
| 144 | iterator_algorithm, |
| 145 | tile.minimum_compute_capability, |
| 146 | tile, |
| 147 | A, |
| 148 | B, |
| 149 | C, |
| 150 | element_epilogue, |
| 151 | StrideSupport.Unity, |
| 152 | epilogue_functor, |
| 153 | ) |
| 154 | |
| 155 | manifest.append(new_operation) |
| 156 | operations.append(new_operation) |
| 157 | |
| 158 | # strided dgrad is not supported by Optimized Dgrad |
| 159 | if (iterator_algorithm == IteratorAlgorithm.Optimized) and ( |
| 160 | conv_kind == ConvKind.Dgrad |
| 161 | ): |
| 162 | continue |
| 163 | |
| 164 | # strided support for Fprop (Analytic/Optimized), Dgrad (Analytic), and Wgrad (Analytic) |
nothing calls this directly
no test coverage detected