Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nnpackage,res] support RoPE operation #14013

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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