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

Function GenerateDwconv2d_Simt

dnn/scripts/cutlass_generator/generator.py:1063–1260  ·  view source on GitHub ↗
(args, conv_kind)

Source from the content-addressed store, hash-verified

1061
1062#
1063def GenerateDwconv2d_Simt(args, conv_kind):
1064 ################################################################################
1065 # warps per threadblock
1066 ################################################################################
1067 warpsPerThreadblocks = []
1068 for warpsPerThreadblock0 in warpsPerThreadblockEdge:
1069 for warpsPerThreadblock1 in warpsPerThreadblockEdge:
1070 if (
1071 warpsPerThreadblock0 / warpsPerThreadblock1 <= warpsPerThreadblockRatio
1072 and warpsPerThreadblock1 / warpsPerThreadblock0
1073 <= warpsPerThreadblockRatio
1074 and warpsPerThreadblock0 * warpsPerThreadblock1
1075 <= warpsPerThreadblockMax
1076 ):
1077 warpsPerThreadblocks.append(
1078 [warpsPerThreadblock0, warpsPerThreadblock1]
1079 )
1080
1081 ################################################################################
1082 # warp shapes
1083 ################################################################################
1084 warpNumThreads = 32
1085 warpShapes = []
1086 for warp0 in warpShapeEdges:
1087 for warp1 in warpShapeEdges:
1088 if (
1089 warp0 / warp1 <= warpShapeRatio
1090 and warp1 / warp0 <= warpShapeRatio
1091 and warp0 * warp1 <= warpShapeMax
1092 and warp0 * warp1 > warpShapeMin
1093 ):
1094 warpShapes.append([warp0, warp1])
1095
1096 # sgemm
1097 (
1098 precisionType,
1099 precisionBits,
1100 threadblockMaxElements,
1101 threadblockTilesL0,
1102 ) = precisions["s"]
1103
1104 layouts = [(LayoutType.TensorNCHW, LayoutType.TensorNCHW)]
1105
1106 math_instructions = [
1107 MathInstruction(
1108 [1, 1, 1],
1109 DataType.f32,
1110 DataType.f32,
1111 DataType.f32,
1112 OpcodeClass.Simt,
1113 MathOperation.multiply_add,
1114 )
1115 ]
1116
1117 min_cc = 50
1118 max_cc = 1024
1119
1120 dst_layouts = [LayoutType.TensorNCHW]

Calls 6

MathInstructionClass · 0.85
maxFunction · 0.85
filterFunction · 0.85
GenerateConv2dFunction · 0.85
TileDescriptionClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected