-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Symbolic shape inference support-2: data propagation-1 #3551
Conversation
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
onnx/defs/data_propagators.h
Outdated
} | ||
} | ||
|
||
inline void ShapeDataPropagator(DataPropagationContext& ctx) { |
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.
what is the purpose of this function?
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.
after reading the rest of the PR now I understand this is the data propagator for shape op... Please update the function name to make it more clear and add some comments
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
… jcw/symbolic-2
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
… jcw/symbolic-2
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
agraph (int32[2,5] x) => (int32[2,5] z) | ||
{ | ||
y = Shape(x) | ||
z = Cast(y) |
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.
I think "Cast" must specify the target of Cast, like "Cast<to = ...>(y)"
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
agraph (int32[2,5] x) => (int32[2,5] w) | ||
{ | ||
y = Shape(x) | ||
z = Unsqueeze(y) |
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.
Adding required input "axes" for Unsqueeze
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
z = Unsqueeze(y) | ||
w = Cast(z) | ||
z = Shape(x) | ||
w = Unsqueeze(z, y) |
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.
I think we can make y a constant as y = Constant <...>()
to test this out.
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.
Of course, that would require a data-propagation for Constant. May be that is the issue (until we allow initializers in the parser).
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.
Added. Since the data propagation of Unsqueeze won't use axes, not sure whether Constant works as expected in this case.
Of course, that would require a data-propagation for Constant. May be that is the issue (until we allow initializers in the parser).
Actually I think we can just skip Constant for data propagation? Constant data can still go into inputDataByName for other op's data propagation function to use, right?
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.
You are right, my mistake, sorry. Please ignore my comment.
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.
I mean it is not required for Unsqueeze
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Unfortunately code from this change breaks building on older compilers (break occurs on CentOS 7.6) |
@postrational Do you have detailed errors that I can look into? Thanks! |
Description
Introduce DataPropagationContext, PartialDataPropagationFunction
Implement selected operators for PartialDataPropagationFunction as below:
Add tests
TODO in another PR:
Add, Concat, Gather, Mul, Reshape, Slice, Size
Motivation and Context
#3506 Second step of symbolic shape inference: partial data propagation