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

[BYOC][TRT] Support batch norm for all ranks <=5, and all axes #7026

Merged
merged 3 commits into from
Dec 8, 2020

Conversation

trevor-m
Copy link
Contributor

@trevor-m trevor-m commented Dec 3, 2020

Previous batch norm only supported rank 4 inputs with axis 1 or 3. Now we support input ranks and axes 1-5.

@trevor-m
Copy link
Contributor Author

trevor-m commented Dec 3, 2020

All tests in test_tensorrt.py passed locally

auto input_dims = TrtDimsToVector(input->getDimensions());
const size_t min_rank = TRT_HAS_IMPLICIT_BATCH(params) ? 3 : 4;
const size_t max_rank = TRT_HAS_IMPLICIT_BATCH(params) ? 4 : 5;
ICHECK_LE(input_dims.size(), max_rank);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you convert these checks to use Diagnostic instead of generating an assertion, we should strive to replace most of these with end-user readable errors.

Copy link
Contributor Author

@trevor-m trevor-m Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jroesch, thanks for reviewing!

These checks are more for sanity checking, since the annotation functions in python/tvm/relay/op/contrib/tensorrt.py will filter out the unsupported ops before they ever get to this code. I don't expect users to ever see these.

Anyway, I can make a separate PR to port all of the ICHECK to Diagnostics.

Copy link
Member

@zhiics zhiics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's have a separate PR to migrate all errors to diagnostic.

@zhiics zhiics merged commit 0095b21 into apache:main Dec 8, 2020
@zhiics
Copy link
Member

zhiics commented Dec 8, 2020

Thanks @trevor-m @anijain2305 @jroesch

TusharKanekiDey pushed a commit to TusharKanekiDey/tvm that referenced this pull request Jan 20, 2021
…e#7026)

* [TRT] Support batch norm for all ranks <=5, and all axis

* Add return false

* Fix TRT < 6 build
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jan 21, 2021
…e#7026)

* [TRT] Support batch norm for all ranks <=5, and all axis

* Add return false

* Fix TRT < 6 build
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
…e#7026)

* [TRT] Support batch norm for all ranks <=5, and all axis

* Add return false

* Fix TRT < 6 build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants