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

Draft: [luci/service] Support Conv2D ops dynamic shape inference #13950

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pcs1265
Copy link
Member

@pcs1265 pcs1265 commented Sep 8, 2024

This supports dynamic shape inference for Conv2D and DepthwiseConv2D.

If the input feature map (ifm) has unknown dimensions, it forwards those unknown dimensions directly to the output shape.

related to : #13697

I am planning to make some PRs for this changes. (Splitting into smaller changes..)

  1. Migrate existing sinf rules (Conv2D, DepthwiseConv2D) to sinf::Algorithm
    • Separate the infer_conv2d_type function used in Conv2D and DepthwiseConv2D into the HelperConv2Ds.h header file.
  2. Implement dynamic shape inference support for Conv2D
    • Add known states for height and width to the OutputSize struct.
    • Make infer_conv2d_type function can aware unknown dimensions.
  3. Implement dynamic shape inference support for DepthwiseConv2D
    • Use known states that added in right before PR step.
  4. (Optional) Refactor to make the infer_conv2d_type function returns a loco::TensorShape object
    • Return the object with only the inferred height and width set (in NHWC format).
    • Other dimensions will be returned as unknown.
    • This can remove redundant casting to get shape
  5. (Optional too) Refactor to remove template from infer_conv2d_type function.
    • But this makes the infer_conv2d_type function has 5(!!) arguments.
  6. Add some tests related to Conv2D and DepthwiseConv2D
    • I am thinking hard about how to add NEG test to dynamic shape inference.

ONE-DCO-1.0-Signed-off-by: Chansu Park [email protected]

This commit adds feature to infer dynamic shape and introduces HelperConv2Ds header containing a function used by Conv2D and DepthwiseConv2D.

ONE-DCO-1.0-Signed-off-by: Chansu Park <[email protected]>
This commit removes debug lines that added mistakenly on last commit.

ONE-DCO-1.0-Signed-off-by: Chansu Park <[email protected]>
This commit replaces shape_get to circle_shape function.

ONE-DCO-1.0-Signed-off-by: Chansu Park <[email protected]>
This commit adds tests related to shape inference for Conv2D and DepthwiseConv2D

ONE-DCO-1.0-Signed-off-by: Chansu Park <[email protected]>
@pcs1265 pcs1265 changed the title Draft: [luci/service] Support Conv2D, DepthwiseConv2D dynamic shape inference Draft: [luci/service] Support Conv2D ops dynamic shape inference Sep 8, 2024
@pcs1265 pcs1265 requested a review from a team September 8, 2024 23:32
@pcs1265 pcs1265 added DRAFT A draft issue or PR for sharing one's current working status and discussion. SSAFY labels Sep 8, 2024
This commit fixes some line to follow clang format.

ONE-DCO-1.0-Signed-off-by: Chansu Park <[email protected]>
This commit removes unused variables in HelperConv2Ds header file.

ONE-DCO-1.0-Signed-off-by: Chansu Park <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRAFT A draft issue or PR for sharing one's current working status and discussion. SSAFY
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant