-
Notifications
You must be signed in to change notification settings - Fork 159
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
[luci/service] Migrate Quantize shape inference rule to sinf::Algorithm #13794
Conversation
This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit check order of headers. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
I was expecting to see test codes... but there exist code migration, but no specific algorithm changes for dynamic shape support. Can you update the title to express this? @zetwhite , @shs-park , Q) do we MUST relocate codes ? I don't fully understand/agree on existing design that @llFreetimell made. |
I think this is not a MUST todo, The Ops we want to implement this time were discussed in this issue and we have plan to implement them in the location of @llFreetimell's firstly. |
Q) does Thoughts,
|
I think re-location is helpful to distinguish which op is ready to support dynamic shape and which op is not yet. If not, others might try to re-investigate to support dynamic shapes for the Quantize node.
For me, this option looks good.
For PR title, how about 'Migrate Quantize shape inference rule to sinf::Algorithm'? (+) /cc @kyeong8139 plz update pr title :) |
👍🏻
good to me :) |
AFAIK roughly, this Op is related to the @jinevening, could you explain a little bit more..? |
I change the title to 'Migrate Quantize shape inference rule to sinf::Algorithm'. I think It is appropriate title about this, too. |
From https://github.com/Samsung/ONE/pull/13794/commits commit message is
can you please fix your commit? |
This commit Migrate Quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
I fixed my commit. |
I agree with this comment. I think adding tc to show it supports dynamic shape well is good idea. +) Also current test you wrote looks good to me. |
https://github.com/Samsung/ONE/pull/13794/commits will show lots of commits you need to update the first commit. |
Quantize Op is included in mixed-precision LLM. |
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.
LGTM!
=)
@@ -24,4 +27,10 @@ luci::CircleNode *CloneNodeLet<CN::OPQR>::visit(const luci::CircleQuantize *) | |||
return _graph->nodes()->create<luci::CircleQuantize>(); | |||
} | |||
|
|||
loco::TensorShape sinf::Algorithm::visit(const luci::CircleQuantize *node) | |||
{ | |||
const auto input_shape = luci::shape_get(node->input()).as<loco::TensorShape>(); |
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.
Could you use circle_shape
function? shape_get
is a temporary function, which will be removed in the future.
CircleShapeInferenceHelper.h
// NOTE Functions in this namespace will be removed after new inference
// algorithms are fully implemented.
// This function is temporary function for deprecating loco::shape_get
loco::NodeShape shape_get(const loco::Node *node);
This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit Migrate Quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit check order of headers. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit Migrate Quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
This commit use circle_shape function instead of shape_get. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
@@ -24,4 +27,10 @@ luci::CircleNode *CloneNodeLet<CN::OPQR>::visit(const luci::CircleQuantize *) | |||
return _graph->nodes()->create<luci::CircleQuantize>(); | |||
} | |||
|
|||
loco::TensorShape sinf::Algorithm::visit(const luci::CircleQuantize *node) | |||
{ | |||
const auto input_shape = circle_shape(node); |
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.
It has to be input's shape.
This commit migrate quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] add dynamic shape tests This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] check code format This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] add dynamic shape tests This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] modify order of headers This commit check order of headers. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] Migrate Quantize shape inference rule to sinf::Algorithm This commit Migrate Quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] add dynamic shape tests This commit add dynamic shape inference tests for quantize. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] Migrate Quantize shape inference rule to sinf::Algorithm This commit Migrate Quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] modify order of headers This commit check order of headers. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]> [luci-quantize] Migrate Quantize shape inference rule to sinf::Algorithm This commit Migrate Quantize shape inference rule to sinf::Algorithm. ONE-DCO-1.0-Signed-off-by: kyeong8139 <[email protected]>
there are some troblems while using git rebase. |
When testing dynamic shape inference, the quantize operation successfully handles it.
I have added tests for this case and migrated the inference code.
Related to: #13697
draft: #13779