|
47 | 47 | PULPRQSConv1DTilingReadyBindings, PULPRQSConv2DTilingReadyBindings, PULPRQSDWConv2DTilingReadyBindings, \ |
48 | 48 | PULPRQSGEMMTilingReadyBindings, PULPRQSiHardswishTilingReadyBindings, PULPRQSMatrixVecTilingReadyBindings, \ |
49 | 49 | PULPRQSTallGEMMTilingReadyBindings, PULPRQSTilingReadyBindings, PULPSGDTilingReadyBindings, \ |
50 | | - PULPSliceTilingReadyBindings, PULPSoftmaxCrossEntropyDualOutputTilingReadyBindings, \ |
51 | | - PULPSoftmaxCrossEntropyGradTilingReadyBindings, PULPSoftmaxCrossEntropyTilingReadyBindings, \ |
52 | | - PULPSoftmaxGradTilingReadyBindings, PULPSoftmaxTilingReadyBindings, PULPTransposeTilingReadyBindings, \ |
53 | | - PULPUniformRQSTilingReadyBindings |
| 50 | + PULPSliceTilingReadyBindings, PULPSoftmaxCrossEntropyGradTilingReadyBindings, \ |
| 51 | + PULPSoftmaxCrossEntropyTilingReadyBindings, PULPSoftmaxGradTilingReadyBindings, PULPSoftmaxTilingReadyBindings, \ |
| 52 | + PULPTransposeTilingReadyBindings, PULPUniformRQSTilingReadyBindings |
54 | 53 | from Deeploy.Targets.PULPOpen.TopologyOptimizationPasses.Passes import PULPAddRequantMergePass, \ |
55 | 54 | PULPConvRequantMergePass, PULPGEMMRequantMergePass, PULPMatMulRequantMergePass |
56 | 55 |
|
|
106 | 105 | iHardswishMapper = NodeMapper(iHardswishParser(), PULPiHardswishTilingReadyBindings) |
107 | 106 | RQSiHardswishMapper = NodeMapper(RQSiHardswishParser(), PULPRQSiHardswishTilingReadyBindings) |
108 | 107 | SoftmaxCrossEntropyLossMapper = NodeMapper(SoftmaxCrossEntropyLossParser(), PULPSoftmaxCrossEntropyTilingReadyBindings) |
109 | | -SoftmaxCrossEntropyLossDualOutputMapper = NodeMapper(SoftmaxCrossEntropyLossParser(), |
110 | | - PULPSoftmaxCrossEntropyDualOutputTilingReadyBindings) |
111 | 108 | SoftmaxCrossEntropyLossGradMapper = NodeMapper(SoftmaxCrossEntropyLossGradParser(), |
112 | 109 | PULPSoftmaxCrossEntropyGradTilingReadyBindings) |
113 | 110 | SGDMapper = NodeMapper(SGDParser(), PULPSGDTilingReadyBindings) |
|
116 | 113 | DequantMapper = NodeMapper(DequantParser(), BasicDequantBindings) |
117 | 114 | GEMMDequantMapper = NodeMapper(PULPGEMMParser(), BasicGEMMBindings) |
118 | 115 | PULPMapping = { |
119 | | - 'Conv': |
120 | | - ConvLayer([FPConv2DMapper, FPDWConv2DMapper]), |
121 | | - 'RequantizedConv': |
122 | | - PULPRQSConvLayer([Conv2DMapper, DWConv2DMapper, Conv1DMapper, DWConv1DMapper]), |
123 | | - 'RequantizedGemm': |
124 | | - PULPRQSGEMMLayer([MatrixVecMapper, TallGEMMMapper, GEMMMapper]), |
125 | | - 'Gemm': |
126 | | - GEMMLayer([FloatGEMMMapper, GEMMDequantMapper]), |
127 | | - 'Gelu': |
128 | | - GELULayer([GELUMapper]), |
129 | | - 'GeluGrad': |
130 | | - GELUGradLayer([GELUGradMapper]), |
131 | | - 'LayerNormalization': |
132 | | - LayerNormLayer([LayerNormMapper]), |
133 | | - 'LayerNormalizationGrad': |
134 | | - LayerNormGradLayer([LayerNormGradMapper]), |
135 | | - 'MaxPool': |
136 | | - MaxPoolLayer([MaxPool1DMapper, MaxPool2DMapper]), |
137 | | - 'RequantizediGELU': |
138 | | - RQSiGELULayer([RQGELU_int8_Mapper]), |
139 | | - 'RQIntegerDiv': |
140 | | - RQIntegerDivLayer([RQIntegerDivMapper]), |
141 | | - 'MatMul': |
142 | | - MatMulLayer([MatMulMapper]), |
143 | | - 'IntegerMean': |
144 | | - ReduceMeanLayer([ReduceMeanMapper]), |
145 | | - 'iSoftmax': |
146 | | - SoftmaxLayer([Softmax_int8_Mapper]), |
147 | | - 'Softmax': |
148 | | - SoftmaxLayer([SoftmaxMapper]), |
149 | | - 'ReduceMean': |
150 | | - ReduceMeanLayer([ReduceMeanMapper]), |
151 | | - 'ReduceSum': |
152 | | - ReduceSumLayer([ReduceSumMapper]), |
153 | | - 'RequantShift': |
154 | | - RequantShiftLayer([UniformRequantShiftMapper, RequantShiftMapper]), |
155 | | - 'Add': |
156 | | - AddLayer([AddMapper]), |
157 | | - 'Flatten': |
158 | | - ReshapeLayer([FlattenMapper]), |
159 | | - 'Gather': |
160 | | - GatherLayer([GatherMapper]), |
161 | | - 'Mul': |
162 | | - MulLayer([MulMapper]), |
163 | | - 'Pad': |
164 | | - PadLayer([Pad1DMapper, Pad2DMapper]), |
165 | | - 'Relu': |
166 | | - ReluLayer([ReluMapper]), |
167 | | - 'Reshape': |
168 | | - ReshapeLayer([ReshapeMapper]), |
169 | | - 'Squeeze': |
170 | | - ReshapeLayer([UnsqueezeMapper]), |
171 | | - 'Transpose': |
172 | | - TransposeLayer([TransposeMapper]), |
173 | | - 'Unsqueeze': |
174 | | - ReshapeLayer([UnsqueezeMapper]), |
175 | | - 'Slice': |
176 | | - SliceLayer([SliceMapper, DMASliceMapper]), |
177 | | - 'RequantizedAdd': |
178 | | - AddLayer([RQAddMapper]), |
179 | | - 'Concat': |
180 | | - ConcatLayer([ConcatMapper]), |
181 | | - 'iRMSNorm': |
182 | | - iRMSNormLayer([iRMSNormMapper]), |
183 | | - 'iHardswish': |
184 | | - iHardswishLayer([iHardswishMapper]), |
185 | | - 'RequantizediHardswish': |
186 | | - RQSiHardswishLayer([RQSiHardswishMapper]), |
187 | | - 'Quant': |
188 | | - QuantLayer([QuantMapper]), |
189 | | - 'Dequant': |
190 | | - QuantLayer([DequantMapper]), |
191 | | - 'SoftmaxGrad': |
192 | | - SoftmaxGradLayer([SoftmaxGradMapper]), |
193 | | - 'SoftmaxCrossEntropyLoss': |
194 | | - SoftmaxCrossEntropyLossLayer([SoftmaxCrossEntropyLossDualOutputMapper, SoftmaxCrossEntropyLossMapper]), |
195 | | - 'SoftmaxCrossEntropyLossGrad': |
196 | | - SoftmaxCrossEntropyLossGradLayer([SoftmaxCrossEntropyLossGradMapper]), |
197 | | - 'SGD': |
198 | | - SGDLayer([SGDMapper]), |
199 | | - 'InPlaceAccumulatorV2': |
200 | | - InPlaceAccumulatorV2Layer([InPlaceAccumulatorV2Mapper]), |
| 116 | + 'Conv': ConvLayer([FPConv2DMapper, FPDWConv2DMapper]), |
| 117 | + 'RequantizedConv': PULPRQSConvLayer([Conv2DMapper, DWConv2DMapper, Conv1DMapper, DWConv1DMapper]), |
| 118 | + 'RequantizedGemm': PULPRQSGEMMLayer([MatrixVecMapper, TallGEMMMapper, GEMMMapper]), |
| 119 | + 'Gemm': GEMMLayer([FloatGEMMMapper, GEMMDequantMapper]), |
| 120 | + 'Gelu': GELULayer([GELUMapper]), |
| 121 | + 'GeluGrad': GELUGradLayer([GELUGradMapper]), |
| 122 | + 'LayerNormalization': LayerNormLayer([LayerNormMapper]), |
| 123 | + 'LayerNormalizationGrad': LayerNormGradLayer([LayerNormGradMapper]), |
| 124 | + 'MaxPool': MaxPoolLayer([MaxPool1DMapper, MaxPool2DMapper]), |
| 125 | + 'RequantizediGELU': RQSiGELULayer([RQGELU_int8_Mapper]), |
| 126 | + 'RQIntegerDiv': RQIntegerDivLayer([RQIntegerDivMapper]), |
| 127 | + 'MatMul': MatMulLayer([MatMulMapper]), |
| 128 | + 'IntegerMean': ReduceMeanLayer([ReduceMeanMapper]), |
| 129 | + 'iSoftmax': SoftmaxLayer([Softmax_int8_Mapper]), |
| 130 | + 'Softmax': SoftmaxLayer([SoftmaxMapper]), |
| 131 | + 'ReduceMean': ReduceMeanLayer([ReduceMeanMapper]), |
| 132 | + 'ReduceSum': ReduceSumLayer([ReduceSumMapper]), |
| 133 | + 'RequantShift': RequantShiftLayer([UniformRequantShiftMapper, RequantShiftMapper]), |
| 134 | + 'Add': AddLayer([AddMapper]), |
| 135 | + 'Flatten': ReshapeLayer([FlattenMapper]), |
| 136 | + 'Gather': GatherLayer([GatherMapper]), |
| 137 | + 'Mul': MulLayer([MulMapper]), |
| 138 | + 'Pad': PadLayer([Pad1DMapper, Pad2DMapper]), |
| 139 | + 'Relu': ReluLayer([ReluMapper]), |
| 140 | + 'Reshape': ReshapeLayer([ReshapeMapper]), |
| 141 | + 'Squeeze': ReshapeLayer([UnsqueezeMapper]), |
| 142 | + 'Transpose': TransposeLayer([TransposeMapper]), |
| 143 | + 'Unsqueeze': ReshapeLayer([UnsqueezeMapper]), |
| 144 | + 'Slice': SliceLayer([SliceMapper, DMASliceMapper]), |
| 145 | + 'RequantizedAdd': AddLayer([RQAddMapper]), |
| 146 | + 'Concat': ConcatLayer([ConcatMapper]), |
| 147 | + 'iRMSNorm': iRMSNormLayer([iRMSNormMapper]), |
| 148 | + 'iHardswish': iHardswishLayer([iHardswishMapper]), |
| 149 | + 'RequantizediHardswish': RQSiHardswishLayer([RQSiHardswishMapper]), |
| 150 | + 'Quant': QuantLayer([QuantMapper]), |
| 151 | + 'Dequant': QuantLayer([DequantMapper]), |
| 152 | + 'SoftmaxGrad': SoftmaxGradLayer([SoftmaxGradMapper]), |
| 153 | + 'SoftmaxCrossEntropyLoss': SoftmaxCrossEntropyLossLayer([SoftmaxCrossEntropyLossMapper]), |
| 154 | + 'SoftmaxCrossEntropyLossGrad': SoftmaxCrossEntropyLossGradLayer([SoftmaxCrossEntropyLossGradMapper]), |
| 155 | + 'SGD': SGDLayer([SGDMapper]), |
| 156 | + 'InPlaceAccumulatorV2': InPlaceAccumulatorV2Layer([InPlaceAccumulatorV2Mapper]), |
201 | 157 | } |
202 | 158 |
|
203 | 159 |
|
|
0 commit comments