Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Feb 10, 2023

The original TensorRT BiasAdd converter does not use axis attribute from nn.bias_add so it only works with NC, NCHW and implicit mode (when batch dimension is removed).
We recently found some NLP and Vision Transformer models are parsed with axis=-1 which caused reshape error later during conversion.

[20:37:10] /home/ubuntu/apache_tvm/tvm/src/runtime/contrib/tensorrt/tensorrt_logger.h:51: Error: ERROR: 4: [graphShapeAnalyzer.cpp::analyzeShapes::1294] Error Code 4: Miscellaneous (IShuffleLayer (Unnamed Layer* 2) [Shuffle]: reshape changes volume. Reshaping [1,768,768,1] to [1,197,768].)

This CR adds support of axis attribute during conversion and related test case for axis=-1

@tvm-bot
Copy link
Collaborator

tvm-bot commented Feb 10, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: tensorrt See #10317 for details

Generated by tvm-bot

Jian Sheng added 2 commits February 10, 2023 20:59
Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

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

lgtm

@ghost
Copy link
Author

ghost commented Feb 11, 2023

Thanks @yongwww ! Can you merge this PR? It passed the CI.

@masahi masahi merged commit 2dd52da into apache:main Feb 11, 2023
ghost pushed a commit to neo-ai/tvm that referenced this pull request Feb 13, 2023
* [TensorRT] Fix BiasAdd with correct axis attribute

* lint

* lint
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.

3 participants