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

Symbolic shape inference support #3506

Closed
jcwchen opened this issue May 27, 2021 · 1 comment
Closed

Symbolic shape inference support #3506

jcwchen opened this issue May 27, 2021 · 1 comment
Assignees
Labels
enhancement Request for new feature or operator shape inference Issues related to shape inference
Milestone

Comments

@jcwchen
Copy link
Member

jcwchen commented May 27, 2021

Current ONNX shape inference limitations

  1. Will stop if it encounters symbolic dimensions. e.g., A (52) concat B (N2) = C (?*2)
  2. Will stop if it bumps into some dynamic scenarios. e.g., Reshape to a dynamically computed shape

Work items

  1. Extend shape inference with symbol generation and propagation
    • Extend graph-level shape inference
    • e.g., 5*2 + N*2 -> Create a new symbol M to represent its inferred shape
  2. Partial data computation and propagation
    • Extend a new optional function PartialDataPropagationFunction just like existing TypeAndShapeInferenceFunction
    • Targeted operators: Add, Cast, Concat, Gather, Mul, Reshap, Shape, Slice, Size, Squeeze, UnSqueeze
  3. (Independent) Propose a new ONNX Op to facilitate shape computation
    • There are examples that they need a few operators to extract certain dimension
    • To simplify these operators, add a new op Dimension for extracting a particular dimension value from the shape of input

I am doing 1. now and we plan to support it in ONNX 1.10.

cc @askhade @gramalingam

@jcwchen jcwchen added the enhancement Request for new feature or operator label May 27, 2021
@jcwchen jcwchen self-assigned this May 27, 2021
@jcwchen jcwchen added the shape inference Issues related to shape inference label May 27, 2021
@jcwchen jcwchen added this to the 1.10 milestone May 27, 2021
@askhade
Copy link
Contributor

askhade commented Jul 30, 2021

Closing this as all the identified work has been done. As more items come up in this area lets create a new issue

@askhade askhade closed this as completed Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for new feature or operator shape inference Issues related to shape inference
Projects
None yet
Development

No branches or pull requests

2 participants