Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- Match GAP9 SDK MLPerf Tiny Performance with Specialised Depthwise and Pointwise Kernels [#206](https://github.com/pulp-platform/Deeploy/pull/206)
- Add support for the X-HEEP platform [#200](https://github.com/pulp-platform/Deeploy/pull/200)
- Add support for Operators for Generic target needed in MAGIA (again) [#195]( https://github.com/pulp-platform/Deeploy/pull/195)
- REFACTOR: Break PULPOpen ↔ GAP9 cycle and core → Generic import [#224](https://github.com/pulp-platform/Deeploy/pull/224)

### Added
- tests for Regular and DW Conv2D with 3x3 kernel
Expand Down Expand Up @@ -93,6 +94,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- The test runner passes `--cores` to the generator for tiled runs
- Siracusa/PULPOpen float output comparison uses a combined absolute + relative tolerance
- Add `pre-commit` to `requirements-dev.txt` and run the reuse hook serially
- `GAP9ClusterEngine` now subclasses `PULPClusterEngine`, so `PULPDeployer` no longer imports from the GAP9 target (removes the PULPOpen ↔ GAP9 import cycle)
- Move `UntiledTileConstraint` from `Deeploy.Targets.Generic.TileConstraints` to `Deeploy.TilingExtension`, so core no longer imports from `Deeploy.Targets`

### Fixed
- Reject non-finite outputs in the PULPOpen/Siracusa floating-point test comparison.
Expand Down Expand Up @@ -124,6 +127,7 @@ This file contains the changelog for the Deeploy project. The changelog is divid
- Fix GAP9 board tests with `--defaultMemLevel L3` reading garbage inputs: place all gapy `--flash-property` options before the positional subcommand and use `image flash run` so the readfs partition (input hex files) is flashed to the device
- Fix Deeploy 101 tutorial errors: `--profileTiling` usage and the moved intrinsics inventory path
- Fix `ConvTranspose` layer: output buffer shape computation.
- `--cores` is now applied to GAP9 cluster engines (previously GAP9 always used the default 8 cores)

### Removed
- removed experimental `enable3x3` flag, from Neureka Engine. Now, 3x3 mode is enabled by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from Deeploy.CommonExtensions.CodeTransformationPasses.MemoryAllocation import MemoryManagementGeneration, \
MemoryPassthroughGeneration
from Deeploy.DeeployTypes import CodeTransformation, NetworkContext, NodeTemplate, ONNXLayer
from Deeploy.Targets.Generic.TileConstraints.UntiledTileConstraint import UntiledTileConstraint
from Deeploy.TilingExtension.UntiledTileConstraint import UntiledTileConstraint

_bypassNodeTemplate = NodeTemplate("""
// BYPASSED (Name: ${nodeName}, Op: ${nodeOp})
Expand Down
10 changes: 5 additions & 5 deletions Deeploy/Targets/GAP9/Platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import numpy as np
import onnx_graphsurgeon as gs

from Deeploy.DeeployTypes import ConstantBuffer, DeploymentEngine, DeploymentPlatform, NetworkContext, NodeMapper, \
NodeTemplate, StructBuffer, TransientBuffer, VariableBuffer
from Deeploy.DeeployTypes import ConstantBuffer, DeploymentPlatform, NetworkContext, NodeMapper, NodeTemplate, \
StructBuffer, TransientBuffer, VariableBuffer
from Deeploy.MemoryLevelExtension.MemoryLevels import MemoryHierarchy, MemoryLevel
from Deeploy.MemoryLevelExtension.NetworkDeployers.MemoryLevelDeployer import MemoryPlatform, MemoryPlatformWrapper
from Deeploy.Targets.GAP9.Templates import AllocateTemplate, FreeTemplate
Expand Down Expand Up @@ -43,6 +43,7 @@
from Deeploy.Targets.PULPOpen.Parsers import PULPConv1DParser, PULPConv2DParser, PULPDWConv1DParser, \
PULPDWConv2DParser, PULPFPConv2DParser, PULPFPDWConv2DParser, PULPGEMMParser, PULPMatrixVecParser, \
PULPPWConv2DParser, PULPStemConv2DParser, PULPTallGEMMParser
from Deeploy.Targets.PULPOpen.Platform import PULPClusterEngine

# Create GAP9-specific NodeMappers
GAP9_RQAddMapper = NodeMapper(RQAddParser(), GAP9RQAddTilingReadyBindings)
Expand Down Expand Up @@ -253,16 +254,15 @@ class GAP9StructBuffer(StructBuffer):
_includeList = ["pmsis.h", "DeeployGAP9Math.h", "pulp_nn_kernels.h", "DeeployMchan.h"]


class GAP9ClusterEngine(DeploymentEngine):
class GAP9ClusterEngine(PULPClusterEngine):

def __init__(self,
name: str,
Mapping = GAP9Mapping,
initCode = "",
includeList = _includeList,
n_cores: int = 8) -> None:
super().__init__(name, Mapping, initCode, includeList)
self.n_cores = n_cores
super().__init__(name, Mapping, initCode, includeList, n_cores)


class GAP9Platform(DeploymentPlatform):
Expand Down
2 changes: 1 addition & 1 deletion Deeploy/Targets/GAP9/Tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from Deeploy.Targets.Generic.TileConstraints.RQSiHardswishTileConstraint import RQSiHardswishTileConstraint
from Deeploy.Targets.Generic.TileConstraints.TransposeTileConstraint import TransposeTileConstraint
from Deeploy.Targets.Generic.TileConstraints.UnaryTileConstraint import UnaryTileConstraint
from Deeploy.Targets.Generic.TileConstraints.UntiledTileConstraint import UntiledTileConstraint
from Deeploy.Targets.PULPOpen.TileConstraints.ConvTileConstraint import Conv2DTileConstraint, RQConv2DTileConstraint
from Deeploy.Targets.PULPOpen.TileConstraints.DWConvTileConstraint import DWConv2DTileConstraint, \
RQDWConv2DTileConstraint
Expand All @@ -45,6 +44,7 @@
SoftmaxCrossEntropyGradTileConstraint, SoftmaxCrossEntropyTileConstraint
from Deeploy.Targets.PULPOpen.TileConstraints.StemConvTileConstraint import RQStemConv2DTileConstraint
from Deeploy.TilingExtension.TilerExtension import TilingReadyNodeBindings
from Deeploy.TilingExtension.UntiledTileConstraint import UntiledTileConstraint

# GAP9-specific tiling ready bindings using ClDma
GAP9RQSConv2DTilingReadyBindings = TilingReadyNodeBindings(nodeBindings = GAP9RQSConv2DBindings,
Expand Down
3 changes: 1 addition & 2 deletions Deeploy/Targets/PULPOpen/Deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from Deeploy.CommonExtensions.OptimizationPasses.TopologyOptimizationPasses.LoweringOptimizationPasses import \
PULPNCHWtoNHWCPass, RemoveGlobalOutputReshapePass, TransposeMatmulInputsPass
from Deeploy.DeeployTypes import ConstantBuffer, DeploymentPlatform, NodeTemplate, TopologyOptimizer, VariableBuffer
from Deeploy.Targets.GAP9.Platform import GAP9ClusterEngine
from Deeploy.Targets.Generic.TopologyOptimizationPasses.Passes import ReshapeConstOptPass, TransposeConstOptPass, \
TransposeMergePass, TransposeNoPermOptPass, TransposeSplitPass
from Deeploy.Targets.PULPOpen.Platform import PULPClusterEngine
Expand Down Expand Up @@ -70,7 +69,7 @@ def annotateNCores(self) -> None:
node = layer.node
engine = self._selectEngine(node)
opRepr = layer.mapper.parser.operatorRepresentation
if isinstance(engine, (PULPClusterEngine, GAP9ClusterEngine)):
if isinstance(engine, PULPClusterEngine):
opRepr["n_cores"] = engine.n_cores

def bind(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion Deeploy/Targets/PULPOpen/Tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from Deeploy.Targets.Generic.TileConstraints.RQSiHardswishTileConstraint import RQSiHardswishTileConstraint
from Deeploy.Targets.Generic.TileConstraints.TransposeTileConstraint import TransposeTileConstraint
from Deeploy.Targets.Generic.TileConstraints.UnaryTileConstraint import UnaryTileConstraint
from Deeploy.Targets.Generic.TileConstraints.UntiledTileConstraint import UntiledTileConstraint
from Deeploy.Targets.PULPOpen.Bindings import PULPAddBindings, PULPBatchNormBindings, PULPConcatBindings, \
PULPFloatConv2DBindings, PULPFloatConvTranspose2DBindings, PULPFloatDWConv2DBindings, PULPFloatGELUBinding, \
PULPFloatGELUGradBinding, PULPFloatGEMMBindings, PULPGatherBindings, PULPiHardswishBindings, PULPiRMSNormBindings, \
Expand Down Expand Up @@ -51,6 +50,7 @@
SoftmaxCrossEntropyGradTileConstraint, SoftmaxCrossEntropyTileConstraint
from Deeploy.Targets.PULPOpen.TileConstraints.StemConvTileConstraint import RQStemConv2DTileConstraint
from Deeploy.TilingExtension.TilerExtension import TilingReadyNodeBindings
from Deeploy.TilingExtension.UntiledTileConstraint import UntiledTileConstraint

PULPRQSConv1DTilingReadyBindings = TilingReadyNodeBindings(nodeBindings = PULPRQSConv1DBindings,
tileConstraint = RQConv1DTileConstraint())
Expand Down
Loading