Skip to content

Commit d7842f1

Browse files
committed
fix: restore integer MatMul support and use snrt_cluster_core_idx() in macros
- Add int8→int32 MatMul binding to SnitchMatMulBindings (was lost when switching from BasicMatMulBindings to Snitch-specific bindings) - Replace core_id with snrt_cluster_core_idx() in BEGIN_SINGLE_CORE and SINGLE_CORE macros, since core_id is not available inside TiledTransformer closure functions
1 parent 4e8448b commit d7842f1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Deeploy/Targets/Snitch/Bindings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from Deeploy.CommonExtensions.DataTypes import float32_t, int8_t, int32_t, uint8_t
1212
from Deeploy.DeeployTypes import CodeTransformation, NodeBinding
1313
from Deeploy.FutureExtension.CodeTransformationPasses.FutureCodeTransformation import FutureGeneration
14-
from Deeploy.Targets.Generic.Templates import ConcatTemplate, iNoNormTemplate
14+
from Deeploy.Targets.Generic.Templates import ConcatTemplate, MatMulTemplate, iNoNormTemplate
1515
from Deeploy.Targets.Generic.TypeCheckers import AddChecker, ConcatChecker, DivChecker, GatherChecker, GEMMChecker, \
1616
HardswishChecker, MatMulChecker, MulChecker, ReshapeChecker, RMSNormChecker, RQAddChecker, SoftmaxChecker, \
1717
TransposeChecker, iNoNormChecker
@@ -129,6 +129,8 @@
129129

130130
# MatMul Bindings (Tiled)
131131
SnitchMatMulBindings = [
132+
NodeBinding(MatMulChecker([PointerClass(int8_t), PointerClass(int8_t)], [PointerClass(int32_t)]),
133+
MatMulTemplate.referenceTemplate, TiledTransformer),
132134
NodeBinding(MatMulChecker([PointerClass(float32_t), PointerClass(float32_t)], [PointerClass(float32_t)]),
133135
FloatMatMulTemplate.referenceTemplate, TiledTransformer)
134136
]

TargetLibraries/Snitch/inc/DeeploySnitchMath.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#include <stdint.h>
1313
#include <string.h>
1414

15-
#define BEGIN_SINGLE_CORE if (core_id == 0) {
15+
#define BEGIN_SINGLE_CORE if (snrt_cluster_core_idx() == 0) {
1616
#define END_SINGLE_CORE }
17-
#define SINGLE_CORE if (core_id == 0)
17+
#define SINGLE_CORE if (snrt_cluster_core_idx() == 0)
1818

1919
#include "CycleCounter.h"
2020
#include "macros.h"

0 commit comments

Comments
 (0)