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

Convolution cast #1609

Merged
merged 21 commits into from
Feb 3, 2023
Merged

Convolution cast #1609

merged 21 commits into from
Feb 3, 2023

Conversation

apbose
Copy link
Collaborator

@apbose apbose commented Jan 23, 2023

Description

Cast the input to the convolution layer input to float since Iconvolution layer does not support INT32 layers as it is an index type. Fix for issue - 1573

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

@apbose apbose self-assigned this Jan 23, 2023
@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 labels Jan 23, 2023
@github-actions github-actions bot requested a review from narendasan January 23, 2023 19:15
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.

There are some changes that do not conform to C++ style guidelines:

diff --git a/home/runner/work/TensorRT/TensorRT/core/conversion/converters/impl/conv_deconv.cpp b/tmp/changes.txt
index a66dc56..5a8efff 100644
--- a/home/runner/work/TensorRT/TensorRT/core/conversion/converters/impl/conv_deconv.cpp
+++ b/tmp/changes.txt
@@ -15,8 +15,8 @@ bool add_conv_deconv(ConversionCtx* ctx, const torch::jit::Node* n, args& args)
  auto in = args[0].ITensor();
  if (in->getType() == nvinfer1::DataType::kINT32) {
    LOG_DEBUG(
-      "Found type  " << in->getType() << " in aten::convolution, casting to "
-      << nvinfer1::DataType::kFLOAT << " for compatibility.");
+        "Found type  " << in->getType() << " in aten::convolution, casting to " << nvinfer1::DataType::kFLOAT
+                       << " for compatibility.");
    in = castITensor(ctx, in, nvinfer1::DataType::kFLOAT);
  }
  // Conv /deconv parameters
ERROR: Some files do not conform to 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 Python style guidelines

@apbose apbose removed their assignment Jan 23, 2023
@narendasan
Copy link
Collaborator

@apbose can you set up precommit to auto lint your code when you commit?

@@ -13,7 +13,12 @@ namespace {
bool add_conv_deconv(ConversionCtx* ctx, const torch::jit::Node* n, args& args) {
// Input to conv/deconv
auto in = args[0].ITensor();

if (in->getType() == nvinfer1::DataType::kINT32) {
LOG_DEBUG(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make this a warning

peri044 and others added 6 commits January 23, 2023 15:29
Signed-off-by: Torch-TensorRT Github Bot <torch-tensorrt.github.bot@nvidia.com>
Signed-off-by: Torch-TensorRT Github Bot <torch-tensorrt.github.bot@nvidia.com>
@narendasan narendasan removed their assignment Jan 25, 2023
gs-olive and others added 2 commits January 25, 2023 11:38
Signed-off-by: Torch-TensorRT Github Bot <torch-tensorrt.github.bot@nvidia.com>
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 Python style guidelines

@github-actions github-actions bot added component: api [Python] Issues re: Python API component: fx component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests documentation Improvements or additions to documentation labels Jan 26, 2023
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 Python style guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: fx component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants