-
Notifications
You must be signed in to change notification settings - Fork 157
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
[Draft][tflchef/circlechef] Use a dedicated type for custom operators #11750
Conversation
if (operation.type() == "Custom") | ||
{ | ||
customcode_set.insert(operation.custom_code()); | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These codes can substitute below codes.
auto op_chef = op_chef_registry().lookup(operation.type()).create(&operation);
if (op_chef->code() == circle::BuiltinOperator_CUSTOM)
customcode_set.insert(operation.type());
Which means above codes should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comment ! :)
@@ -182,6 +194,12 @@ std::set<std::string> gather_customcode_set(const ::circlechef::ModelRecipe &mod | |||
const auto &graph = model_recipe.graph(g); | |||
for (const auto &operation : graph.operation()) | |||
{ | |||
if (operation.type() == "Custom") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
80847a1
to
f9cf248
Compare
@@ -18,13 +18,14 @@ operand { | |||
} | |||
} | |||
operation { | |||
type: "All" | |||
type: "Custom" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to land separate PRs for compiler
and res
files,
we need to introduce some intermediate changes
for example,
1/ in res
, introduce extype: "Custom"
and custom_code: "All"
2/ in tflchef
, if extype
exist, use that, if not use type
3/ in res
, change type
and remove extype
4/ in tflchef
remove related with extype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment!! I will upload the code PR as you guided me. :)
5f63b71
to
6950305
Compare
@@ -29,7 +29,11 @@ AddV2Chef::custom_value(flatbuffers::FlatBufferBuilder &fbb) const | |||
{ | |||
auto &operation = (*_operation); | |||
|
|||
assert(operation.type() == "AddV2"); | |||
if (operation.has_extype() && operation.extype() == "Custom") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not check type() ==
Custom` too ?
{ | ||
assert(operation.has_custom_code()); | ||
assert(operation.custom_code() == "AddV2"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as these blocks are repeated several times, would be better to add a method
50d3808
to
874b1fd
Compare
On going draft to use a dedicated type for custom operators in the recipe. ONE-DCO-1.0-Signed-off-by: SeungHui Lee <[email protected]>
874b1fd
to
714621e
Compare
On going draft to use a dedicated type for custom operators in the recipe.
ONE-DCO-1.0-Signed-off-by: SeungHui Lee [email protected]
Related Issue : #11741