Deeploy.Targets.PULPOpen.TileConstraints.ConvTileConstraint.Conv2DTileConstraint

class Deeploy.Targets.PULPOpen.TileConstraints.ConvTileConstraint.Conv2DTileConstraint

Bases: TileConstraint

Methods

__init__()

__init__()

addGeometricalConstraint(tilerModel, ...)

Add geometrical constraints for Conv2D tiling.

addPolicyConstraint(tilerModel, parseDict, ctxt)

Override this function to add your custom constraints to your node.

computeInputCube(kernelShape, pads, strides, ...)

constructSymbolicNodeRep(tilerModel, ...)

extractBaseAddr(tilingSolution, ...)

getBaseAddr(tilingSolution, targetMemLevel, name)

sanitizeTilingSchedule(tilingSchedule)

serializeTilingSolution(tilingSolution, ...)

Compute the required input tiles as a sequence of HyperRectangles

wrapTilingSolution(tilingSolution, ...)

static addGeometricalConstraint(tilerModel: TilerModel, parseDict: Dict, ctxt: NetworkContext) TilerModel

Add geometrical constraints for Conv2D tiling.

For spatial tiling, input tiles require extra memory for overlap regions at tile boundaries (kernel receptive field). This method accounts for worst-case overlap on all sides.

Future optimization: Currently uses worst-case memory allocation (kernel_size - 1 on all sides). A more memory-efficient approach would compute exact per-tile memory requirements during serializeTilingSolution based on actual tile positions, but this requires more extensive framework changes.

static addPolicyConstraint(tilerModel: TilerModel, parseDict: Dict, ctxt: NetworkContext) TilerModel

Override this function to add your custom constraints to your node.

classmethod serializeTilingSolution(tilingSolution: NodeMemoryConstraint, absoluteOutputCubes: List[AbsoluteHyperRectangle], targetMemLevel: str, ctxt: NetworkContext, operatorRepresentation: Dict[str, str | Any]) Tuple[VariableReplacementScheme, TilingSchedule]

Compute the required input tiles as a sequence of HyperRectangles

Parameters:
  • tilingSolution (NodeMemoryConstraint) – The final tiling solution computed in the midend

  • absoluteOutputCubes (List[AbsoluteHyperRectangle]) – A list of HyperRectangles that represent tiles of the operator’s outputs with absolute offsets

  • targetMemLevel (str) – The name of the MemoryLevel registered within the Platform’s MemoryHierarchy where tiles should be transferred into (e.g.: L2, L1,… )

  • ctxt (NetworkContext) – The current NetworkContext

  • operatorRepresentation (Dict) – The operator’s node representation dictionary

Returns:

Return a VariableReplacementScheme to express which expressions within the target template might have to be replaced due to tiling. Also return a TilingSchedule to define one input HyperRectangle tuple for each output tile

Return type:

Tuple[VariableReplacementScheme, TilingSchedule]

Raises:

Exception – Raises an exception unless overridden in the calling class