Skip to content

Fix shape data propagation function to handle missing optional parameters #5219

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

Merged
merged 3 commits into from
May 11, 2023

Conversation

BowenBao
Copy link
Contributor

@BowenBao BowenBao commented May 11, 2023

Fixes #5212

…ters

Signed-off-by: BowenBao <bowbao@microsoft.com>
Signed-off-by: BowenBao <bowbao@microsoft.com>
@gramalingam
Copy link
Contributor

Thanks for the fix. I don't think it has to do with optional parameter (because Shape doesn't have an optional parameter). But this problem can show up in other cases (eg., erroneous model, etc.). The model-checker will catch cases where we have a call to Shape without a parameter, but if we try running shape-inference before running the checker (as you mentioned elsewhere), this could be a problem. It could happen in other places too, because this style of code has been used quite a bit.

@gramalingam
Copy link
Contributor

As I discuss elsewhere, this could be a cascading problem arising out of the fact that attribute-parameters with default-values are not yet handled by checker/inference.

@jcwchen jcwchen added the module: shape inference Issues related to shape inference label May 11, 2023
@BowenBao
Copy link
Contributor Author

Thanks @gramalingam for analysis! Indeed there is another root problem to be fixed. I'm going to try track in the example model where it first happened. Will update on the original issue.

@gramalingam
Copy link
Contributor

gramalingam commented May 11, 2023

Thanks @gramalingam for analysis! Indeed there is another root problem to be fixed. I'm going to try track in the example model where it first happened. Will update on the original issue.

This change helps me process the short-example you had ("maf_gpt2_tiny.onnx"). May be you can try it on the bigger example. (I am sure there will be other places where change is required to handle attributes-with-default-values.)

@gramalingam gramalingam merged commit fa9e209 into onnx:main May 11, 2023
@BowenBao

This comment was marked as duplicate.

q-ycong-p pushed a commit to q-ycong-p/onnx that referenced this pull request May 18, 2023
…meters (onnx#5219)

Signed-off-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Yu Cong <congyc@amazon.com>
adityagoel4512 pushed a commit to adityagoel4512/onnx that referenced this pull request Jul 28, 2023
…meters (onnx#5219)

Signed-off-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
@abock abock mentioned this pull request Aug 3, 2023
5 tasks
yuanyao-nv pushed a commit to yuanyao-nv/onnx that referenced this pull request Aug 7, 2023
…meters (onnx#5219)

Signed-off-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
yuanyao-nv pushed a commit to yuanyao-nv/onnx that referenced this pull request Aug 7, 2023
…meters (onnx#5219)

Signed-off-by: BowenBao <bowbao@microsoft.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Yuan Yao <yuanyao@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: shape inference Issues related to shape inference
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Segfault running shape inference with data_prop=True on model with nested function.
3 participants