|
1 | 1 | # SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna |
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | | - |
5 | 4 | """ |
6 | 5 | GAP9-specific bindings using cl_dma.h API instead of low-level MCHAN. |
7 | 6 |
|
|
12 | 11 | import itertools |
13 | 12 |
|
14 | 13 | from Deeploy.AbstractDataTypes import PointerClass |
| 14 | +from Deeploy.CommonExtensions.CodeTransformationPasses.MemoryAllocation import ArgumentStructGeneration, \ |
| 15 | + MemoryManagementGeneration, MemoryPassthroughGeneration |
15 | 16 | from Deeploy.CommonExtensions.DataTypes import FloatDataTypes, IntegerDataTypes, SignedIntegerDataTypes, float32_t, \ |
16 | 17 | int8_t, int32_t, int64_t, uint8_t |
17 | 18 | from Deeploy.DeeployTypes import CodeTransformation, NodeBinding |
18 | 19 | from Deeploy.FutureExtension.Bindings.AutoFutureBinding import AutoFutureBinding |
19 | | -from Deeploy.CommonExtensions.CodeTransformationPasses.MemoryAllocation import ArgumentStructGeneration, \ |
20 | | - MemoryManagementGeneration, MemoryPassthroughGeneration |
21 | 20 | from Deeploy.FutureExtension.CodeTransformationPasses.FutureCodeTransformation import FutureGeneration |
22 | | -from Deeploy.TilingExtension.CodeTransformationPasses.TilingVariableReplacement import TilingVariableReplacement, \ |
23 | | - TilingVariableReplacementUpdate |
24 | | -from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPClusterSynch import PULPSynchCoresPass |
25 | | -from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPClusterTiling import PULPClusterTiling |
26 | | -from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPL3Tiling import PULPL3Tiling |
27 | | -from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPProfileUntiled import PULPProfileUntiled |
28 | | -from Deeploy.Targets.PULPOpen.Bindings import TilingCallClosure, ForkClosure, \ |
29 | | - MemoryAwareFunctionCallClosure, L3MemoryAwareFunctionCallClosure, MemoryAwareForkTransformer |
30 | | -from Deeploy.Targets.PULPOpen.DataTypes import PULPDMAFuture |
31 | | -from Deeploy.Targets.GAP9.DMA.MchanDma import GAP9MchanDma |
32 | 21 | from Deeploy.Targets.GAP9.DMA.L3Dma import gap9L3DmaHack |
33 | | - |
| 22 | +from Deeploy.Targets.GAP9.DMA.MchanDma import GAP9MchanDma |
34 | 23 | # Import templates from PULPOpen and Generic |
35 | 24 | from Deeploy.Targets.Generic.Templates import AddTemplate, ConcatTemplate, DequantTemplate, FloatReduceMeanTemplate, \ |
36 | 25 | FloatReduceSumTemplate, GatherTemplate, QuantTemplate, RQSiGELUTemplate, SliceTemplate, iHardswishTemplate |
37 | 26 | from Deeploy.Targets.Generic.TypeCheckers import AddChecker, ConcatChecker, ConvChecker, DequantChecker, \ |
38 | 27 | GatherChecker, GELUChecker, GEMMChecker, HardswishChecker, LayerNormChecker, MatMulChecker, MulChecker, \ |
39 | 28 | QuantChecker, ReduceMeanChecker, ReluChecker, ReshapeChecker, RQAddChecker, RQHardswishChecker, SGDChecker, \ |
40 | 29 | SliceChecker, SoftmaxChecker, SoftmaxCrossEntropyLossChecker, TransposeChecker |
| 30 | +from Deeploy.Targets.PULPOpen.Bindings import ForkClosure, L3MemoryAwareFunctionCallClosure, \ |
| 31 | + MemoryAwareForkTransformer, MemoryAwareFunctionCallClosure, TilingCallClosure |
| 32 | +from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPClusterSynch import PULPSynchCoresPass |
| 33 | +from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPClusterTiling import PULPClusterTiling |
| 34 | +from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPL3Tiling import PULPL3Tiling |
| 35 | +from Deeploy.Targets.PULPOpen.CodeTransformationPasses.PULPProfileUntiled import PULPProfileUntiled |
| 36 | +from Deeploy.Targets.PULPOpen.DataTypes import PULPDMAFuture |
41 | 37 | from Deeploy.Targets.PULPOpen.Templates import ConvTemplate, DMASliceTemplate, FloatAddTemplate, FloatConvTemplate, \ |
42 | 38 | FloatGELUTemplate, FloatGemmTemplate, FloatLayernormTemplate, FloatMatMulTemplate, FloatMaxPoolTemplate, \ |
43 | 39 | FloatMulTemplate, FloatReluTemplate, FloatSoftmaxTemplate, GEMMTemplate, MatrixVectorTemplate, MaxPool2DTemplate, \ |
|
46 | 42 | iRMSNormTemplate, iSoftmaxTemplate |
47 | 43 | from Deeploy.Targets.PULPOpen.TypeCheckers import PULPConvChecker, PULPLinearChecker, PULPMaxPoolChecker, \ |
48 | 44 | PULPRequantShiftChecker |
49 | | - |
| 45 | +from Deeploy.TilingExtension.CodeTransformationPasses.TilingVariableReplacement import TilingVariableReplacement, \ |
| 46 | + TilingVariableReplacementUpdate |
50 | 47 |
|
51 | 48 | # GAP9-specific transformer using cl_dma.h API |
52 | 49 | GAP9Transformer = CodeTransformation([ |
|
102 | 99 | MemoryPassthroughGeneration(), |
103 | 100 | FutureGeneration()]) |
104 | 101 |
|
105 | | - |
106 | 102 | # =============================================================================== |
107 | 103 | # GAP9-specific bindings using ClDma instead of MchanDma |
108 | 104 | # All bindings below use GAP9Transformer or GAP9ClusterTransformer |
|
0 commit comments