Skip to content

Commit

Permalink
[nnpackage,res] support RoPE operation (#14013)
Browse files Browse the repository at this point in the history
 [circleschema] add RoPE operation

ONE-DCO-1.0-Signed-off-by: youngsik kim <[email protected]>
  • Loading branch information
ys44kim authored Sep 24, 2024
1 parent 7c6a18c commit e865a10
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion nnpackage/schema/circle_schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
// Version 0.6: Base up to TensorFlow Lite v2.13.0 schema.
// Version 0.7: Base up to TensorFlow Lite v2.15.0 schema, deprecate data_format in Subgraph table
// Version 0.8: GRU op is added. UINT4 is added.
// Version 0.9: GGML_Q{X}_{Y} types are added. Weight compression option is added
// Version 0.9: GGML_Q{X}_{Y} types are added. Weight compression option is added.
// ROPE op is added.

namespace circle;

Expand Down Expand Up @@ -286,6 +287,7 @@ table Tensor {
// set of acceptable options.
// LINT.IfChange
enum BuiltinOperator : int32 {
ROPE = -7,
RMS_NORM = -6,
GRU = -5,
BCQ_GATHER = -4,
Expand Down Expand Up @@ -636,6 +638,7 @@ union BuiltinOptions {
BitcastOptions,
BitwiseXorOptions,
RightShiftOptions,
RoPEOptions = 249,
RmsNormOptions = 250,
GRUOptions = 251,
BCQGatherOptions = 252,
Expand Down Expand Up @@ -1525,6 +1528,15 @@ table RmsNormOptions {
epsilon:float;
}

enum RoPEMode : int {
GPT_NEOX,
GPT_J,
}

table RoPEOptions {
mode: RoPEMode;
}

// An OperatorCode can be an enum value (BuiltinOperator) if the operator is a
// builtin, or a string if the operator is custom.
table OperatorCode {
Expand Down
14 changes: 13 additions & 1 deletion res/CircleSchema/0.9/circle_schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
// Version 0.6: Base up to TensorFlow Lite v2.13.0 schema.
// Version 0.7: Base up to TensorFlow Lite v2.15.0 schema, deprecate data_format in Subgraph table
// Version 0.8: GRU op is added. UINT4 is added.
// Version 0.9: GGML_Q{X}_{Y} types are added. Weight compression option is added
// Version 0.9: GGML_Q{X}_{Y} types are added. Weight compression option is added.
// ROPE op is added.

namespace circle;

Expand Down Expand Up @@ -286,6 +287,7 @@ table Tensor {
// set of acceptable options.
// LINT.IfChange
enum BuiltinOperator : int32 {
ROPE = -7,
RMS_NORM = -6,
GRU = -5,
BCQ_GATHER = -4,
Expand Down Expand Up @@ -636,6 +638,7 @@ union BuiltinOptions {
BitcastOptions,
BitwiseXorOptions,
RightShiftOptions,
RoPEOptions = 249,
RmsNormOptions = 250,
GRUOptions = 251,
BCQGatherOptions = 252,
Expand Down Expand Up @@ -1525,6 +1528,15 @@ table RmsNormOptions {
epsilon:float;
}

enum RoPEMode : int {
GPT_NEOX,
GPT_J,
}

table RoPEOptions {
mode: RoPEMode;
}

// An OperatorCode can be an enum value (BuiltinOperator) if the operator is a
// builtin, or a string if the operator is custom.
table OperatorCode {
Expand Down

0 comments on commit e865a10

Please sign in to comment.