MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / GenerateConv2d_Simt

Function GenerateConv2d_Simt

dnn/scripts/cutlass_generator/generator.py:188–279  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

186
187
188def GenerateConv2d_Simt(args):
189 operations = []
190
191 layouts = [(LayoutType.TensorNC4HW4, LayoutType.TensorC4RSK4)]
192
193 math_instructions = [
194 MathInstruction(
195 [1, 1, 4],
196 DataType.s8,
197 DataType.s8,
198 DataType.s32,
199 OpcodeClass.Simt,
200 MathOperation.multiply_add,
201 )
202 ]
203
204 dst_layouts = [
205 LayoutType.TensorNC4HW4,
206 LayoutType.TensorNC32HW32,
207 LayoutType.TensorNHWC,
208 LayoutType.TensorNHWC,
209 LayoutType.TensorNCHW,
210 ]
211
212 dst_types = [DataType.s8, DataType.s8, DataType.u4, DataType.s4, DataType.f32]
213
214 max_cc = 1024
215
216 for math_inst in math_instructions:
217 for layout in layouts:
218 for dst_type, dst_layout in zip(dst_types, dst_layouts):
219 if dst_type == DataType.s4 or dst_type == DataType.u4:
220 min_cc = 75
221 use_special_optimization = SpecialOptimizeDesc.NoneSpecialOpt
222 else:
223 min_cc = 61
224 use_special_optimization = SpecialOptimizeDesc.ConvFilterUnity
225 tile_descriptions = [
226 TileDescription(
227 [128, 128, 32], 2, [2, 4, 1], math_inst, min_cc, max_cc
228 ),
229 TileDescription(
230 [128, 64, 32], 2, [2, 2, 1], math_inst, min_cc, max_cc
231 ),
232 TileDescription(
233 [64, 128, 32], 2, [1, 4, 1], math_inst, min_cc, max_cc
234 ),
235 TileDescription(
236 [128, 32, 32], 2, [2, 1, 1], math_inst, min_cc, max_cc
237 ),
238 TileDescription(
239 [32, 128, 32], 2, [1, 2, 1], math_inst, min_cc, max_cc
240 ),
241 TileDescription(
242 [32, 64, 32], 2, [1, 1, 1], math_inst, min_cc, max_cc
243 ),
244 TileDescription(
245 [64, 32, 32], 2, [1, 1, 1], math_inst, min_cc, max_cc

Callers 1

GenerateConv2dOperationsFunction · 0.85

Calls 3

MathInstructionClass · 0.85
GenerateConv2dFunction · 0.85
TileDescriptionClass · 0.70

Tested by

no test coverage detected