Skip to content

Commit b252779

Browse files
committed
feat: replace trivial all-1.0 weights with true FP32 random initialization
Xavier uniform init for MatMul weights, RMSNorm weights ~1.0±0.15, diverse random inputs. Verified 0/64 errors on both tiled and untiled.
1 parent 623baed commit b252779

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

Deeploy/Targets/Snitch/Templates/FloatDivTemplate.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from typing import Dict, List, Tuple
66

7+
from mako.template import Template as MakoTemplate
8+
79
from Deeploy.DeeployTypes import NetworkContext, NodeTemplate, OperatorRepresentation
810

911

@@ -19,13 +21,13 @@ def alignToContext(self, ctxt: NetworkContext,
1921
# Check if scalar broadcasting
2022
is_scalar = operatorRepresentation.get('is_scalar', False)
2123

22-
# Dynamically select template based on is_scalar flag
24+
# IMPORTANT: Must recompile self.template (Mako Template object),
25+
# not just assign self.templateStr. NodeTemplate.generate() uses
26+
# the pre-compiled self.template, not self.templateStr.
2327
if is_scalar:
24-
# Use scalar broadcasting version
25-
self.templateStr = FloatDivScalarTemplateStr
28+
self.template = MakoTemplate(FloatDivScalarTemplateStr, strict_undefined=True)
2629
else:
27-
# Use element-wise version
28-
self.templateStr = FloatDivTemplateStr
30+
self.template = MakoTemplate(FloatDivTemplateStr, strict_undefined=True)
2931

3032
return ctxt, operatorRepresentation, []
3133

Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)