Skip to content

Support shape analysis for dynamic fallback #1111

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

Closed
wants to merge 2 commits into from

Conversation

Njuapp
Copy link
Contributor

@Njuapp Njuapp commented Jun 13, 2022

Signed-off-by: Cheng Hang [email protected]

Description

Previously, when encountered ops/modules that have to fall back and meanwhile dynamic shape is used, shape analysis would fail when doing generateRandomInputs(), because tensors with -1 contained in shape cannot be created.

To support dynamic fallback, we have to firstly overcome this failure, by doing generateRandomInputs() with min/max/opt shape info. Then shape analysis can be executed three times, with min/max/opt shapes correspondingly.

Fixes #1113

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@narendasan
Copy link
Collaborator

I think this feature needs a formal design. Please open an RFC for this. For example just through discussion about this feature one issue we thought of is that TensorRT has limitations in number of free dimensions in dynamic shape for some layers. We should augment the converter library to report these cases back so that we can check for support before moving forward. I suspect there are other similar cases

@narendasan narendasan added the WIP Work is in progress, pull request should not be merged yet label Jun 17, 2022
@Njuapp Njuapp force-pushed the dynamic-fallback branch from d24a818 to 3772294 Compare July 28, 2022 14:14
@github-actions github-actions bot added the component: lowering Issues re: The lowering / preprocessing passes label Aug 3, 2022
@ncomly-nvidia ncomly-nvidia added the release: v1.3 Tagged to be included in v1.3 label Nov 1, 2022
@narendasan narendasan closed this Nov 1, 2022
@Njuapp Njuapp deleted the dynamic-fallback branch November 14, 2022 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: core Issues re: The core compiler component: lowering Issues re: The lowering / preprocessing passes component: partitioning release: v1.3 Tagged to be included in v1.3 WIP Work is in progress, pull request should not be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Shape analysis failure when encountered dynamic fallback
4 participants