Skip to content

fix: fix the renaming error in squeeze converter #1187

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

bowang007
Copy link
Collaborator

Signed-off-by: Bo Wang [email protected]

Description

Some converters may have the risks of renaming ITensors, which might cause errors.

Fixes: #930 , #982

More PRs related to this PR:
#1004 , #1167 ,

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

@bowang007 bowang007 requested review from peri044 and narendasan July 18, 2022 22:00
@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests labels Jul 18, 2022
@github-actions github-actions bot requested a review from andi4191 July 18, 2022 22:00
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

@@ -26,7 +26,8 @@ auto squeeze_registrations TORCHTRT_UNUSED = RegisterNodeConversionPatterns().pa
}

if (selfDim[dim] != 1) {
auto out = ctx->AssociateValueAndTensor(n->outputs()[0], self);
auto id_layer = ctx->net->addIdentity(*self);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could use already existing utility for this

nvinfer1::ITensor* applyIdentityOp(ConversionCtx* ctx, nvinfer1::ITensor* tensor, const std::string& tensor_name) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks @peri044. BTW, do we still need this test case

TEST(Converters, ATenSqueezeDontNeedSqueezeConvertsCorrectly) {
? I'm thinking of deleting it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good. This test doesn't seem useful.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@peri044 it seems that we should have an explicit name for output tensor if we want to use this util:

nvinfer1::ITensor* applyIdentityOp(ConversionCtx* ctx, nvinfer1::ITensor* tensor, const std::string& tensor_name) {
.
I checked around but have no idea what name would be appropriate, any idea?

@narendasan narendasan added Story: Binding Names Issues related to binding names, format and uniqueness labels Jul 19, 2022
@github-actions github-actions bot requested a review from peri044 July 19, 2022 04:37
@ncomly-nvidia
Copy link
Contributor

@narendasan @bowang007 is it possible to get this into v1.2? Would be good to close out this issue in this release.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

This seems fine, are there any other binding name changes that need to be merged?

@bowang007
Copy link
Collaborator Author

This seems fine, are there any other binding name changes that need to be merged?

I don't think so.

@narendasan narendasan added the release: v1.2 Tagged to be included in v1.2 label Jul 29, 2022
@github-actions github-actions bot requested a review from narendasan July 29, 2022 00:48
@peri044
Copy link
Collaborator

peri044 commented Jul 30, 2022

There are merge conflicts and these changes are already merged via another PR #1167

@peri044 peri044 closed this Jul 30, 2022
@bowang007 bowang007 deleted the fix_renaming_squeeze branch August 19, 2022 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests release: v1.2 Tagged to be included in v1.2 Story: Binding Names Issues related to binding names, format and uniqueness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Compilation causes error: ValueError: stoi
5 participants