Skip to content

Commit

Permalink
[res] CircleRecipes and TFLiteRecipes added for RmsNorm (#14022)
Browse files Browse the repository at this point in the history
This commit adds RmsNorm test recipe in CircleRecipes/TFLiteRecipes.

ONE-DCO-1.0-Signed-off-by: Seockho Kim [email protected]
  • Loading branch information
seockho-kim authored Sep 23, 2024
1 parent 273f81f commit 82a7d90
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 0 deletions.
46 changes: 46 additions & 0 deletions res/CircleRecipes/RmsNorm_000/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
operand {
name: "ifm"
type: FLOAT32
shape { dim: 1 dim: 3 dim: 3 dim: 4 }
}
operand {
name: "gamma"
type: FLOAT32
shape { dim: 4 }
filler {
tag: "explicit"
arg: "1.0"
arg: "1.0"
arg: "1.0"
arg: "1.0"
}
}
operand {
name: "beta"
type: FLOAT32
shape { dim: 4 }
filler {
tag: "explicit"
arg: "0.0"
arg: "0.0"
arg: "0.0"
arg: "0.0"
}
}
operand {
name: "ofm"
type: FLOAT32
shape { dim: 1 dim: 3 dim: 3 dim: 4 }
}
operation {
type: "RmsNorm"
input: "ifm"
input: "gamma"
input: "beta"
output: "ofm"
rms_norm_options {
epsilon: 0.0001
}
}
input: "ifm"
output: "ofm"
Empty file.
117 changes: 117 additions & 0 deletions res/TensorFlowLiteRecipes/Net_RmsNorm_000/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
operand {
name: "Input"
type: FLOAT32
shape {
dim: 1
dim: 1
dim: 4
}
}
operand {
name: "RmsNorm/Mul/Square"
type: FLOAT32
shape {
dim: 1
dim: 1
dim: 4
}
}
operand {
name: "RmsNorm/Mean/Axis"
type: INT32
shape {
}
filler {
tag: "explicit"
arg: "-1"
}
}
operand {
name: "RmsNorm/Mean/MeanSquare"
type: FLOAT32
shape {
dim: 1
dim: 1
dim: 1
}
}
operand {
name: "RmsNorm/Add/Epsilon"
type: FLOAT32
shape {
}
filler {
tag: "explicit"
arg: "1e-06"
}
}
operand {
name: "RmsNorm/Add/MeanSquare_plus_eps"
type: FLOAT32
shape {
dim: 1
dim: 1
dim: 1
}
}
operand {
name: "RmsNorm/Sqrt/RMS"
type: FLOAT32
shape {
dim: 1
dim: 1
dim: 1
}
}
operand {
name: "RmsNorm/Mul/RmsNorm"
type: FLOAT32
shape {
dim: 1
dim: 1
dim: 4
}
}
operation {
type: "Mul"
input: "Input"
input: "Input"
output: "RmsNorm/Mul/Square"
mul_options {
activation: NONE
}
}
operation {
type: "Mean"
input: "RmsNorm/Mul/Square"
input: "RmsNorm/Mean/Axis"
output: "RmsNorm/Mean/MeanSquare"
mean_options {
keep_dims: true
}
}
operation {
type: "Add"
input: "RmsNorm/Mean/MeanSquare"
input: "RmsNorm/Add/Epsilon"
output: "RmsNorm/Add/MeanSquare_plus_eps"
add_options {
activation: NONE
}
}
operation {
type: "Rsqrt"
input: "RmsNorm/Add/MeanSquare_plus_eps"
output: "RmsNorm/Sqrt/RMS"
}
operation {
type: "Mul"
input: "Input"
input: "RmsNorm/Sqrt/RMS"
output: "RmsNorm/Mul/RmsNorm"
mul_options {
activation: NONE
}
}
input: "Input"
output: "RmsNorm/Mul/RmsNorm"
7 changes: 7 additions & 0 deletions res/TensorFlowLiteRecipes/Net_RmsNorm_000/test.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# To check if this network is converted to circle RmsNorm op

RULE "VERIFY_FILE_FORMAT" $(verify_file_format) '=' 1

RULE "RMS_NORM_EXIST" $(op_count RMS_NORM) '=' 1
RULE "NO_ADD" $(op_count ADD) '=' 0
RULE "NO_MUL" $(op_count MUL) '=' 0

0 comments on commit 82a7d90

Please sign in to comment.