@@ -49,11 +49,7 @@ def addGeometricalConstraint(tilerModel: TilerModel, parseDict: Dict, ctxt: Netw
4949 tilerModel .addConstraint (outputBatchVar == inputBatchVar )
5050 tilerModel .addConstraint (outputChannelVar == inputChannelVar )
5151
52- weightBuffer = ctxt .lookup (weightBufferName )
53- if hasattr (weightBuffer , "_memoryLevel" ) and weightBuffer ._memoryLevel == "WeightMemory_SRAM" :
54- tilerModel .addConstraint (weightOutChannelVar == weightOutChannelVar .Max ())
55- else :
56- tilerModel .addConstraint (weightOutChannelVar == outputChannelVar )
52+ tilerModel .addConstraint (weightOutChannelVar == weightOutChannelVar .Max ())
5753
5854 tilerModel .addConstraint (inputHeightVar >= 3 )
5955 tilerModel .addConstraint (inputWidthVar >= 3 )
@@ -214,10 +210,8 @@ def serializeTilingSolution(
214210 replacementTypes ['weight_addr_offset' ] = PointerClass (uint32_t )
215211 for absoluteCube in absoluteOutputCubes :
216212 COffset , CSize = absoluteCube .absoluteOffset [- 1 ], absoluteCube .rectangle .dims [- 1 ]
217- # WeightCube = HyperRectangle((COffset, 0, 0), (CSize, weightShape[-2], weightShape[-1]))
218- WeightCube = HyperRectangle (
219- (COffset , 0 , 0 , 0 ),
220- (CSize , weightShape [- 3 ], weightShape [- 2 ], weightShape [- 1 ]))
213+ WeightCube = HyperRectangle ((COffset , 0 , 0 , 0 ),
214+ (CSize , weightShape [- 3 ], weightShape [- 2 ], weightShape [- 1 ]))
221215 replacements ['weight_addr_offset' ].append (calculateFlatOffsetInBytes (WeightCube , weightBuffer ))
222216 else :
223217 inputWeightBaseOffsets , outputWeightBaseOffsets = cls .extractBaseAddr (tilingSolution , targetMemLevel ,
@@ -226,8 +220,7 @@ def serializeTilingSolution(
226220 outputBaseOffsets .update (outputWeightBaseOffsets )
227221
228222 for cube , load in zip (outputCubes , inputLoadSchedule ):
229- COffset , CSize = cube .offset [- 1 ], cube .dims [- 1 ]
230- load ['weight' ] = HyperRectangle ((COffset , 0 , 0 ), (CSize , weightShape [- 2 ], weightShape [- 1 ]))
223+ load ['weight' ] = HyperRectangle ((0 ,) * len (weightShape ), tuple (weightShape ))
231224
232225 tilingSchedule = TilingSchedule (inputBaseOffsets , outputBaseOffsets , inputLoadSchedule , outputLoadSchedule )
233226 variableReplacementSchedule = VariableReplacementScheme (replacements , replacementTypes )
0 commit comments