-
Notifications
You must be signed in to change notification settings - Fork 356
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
[feat] Add support for integers in aten::abs converter (#35) #1232
[feat] Add support for integers in aten::abs converter (#35) #1232
Conversation
Adds support for aten::abs with integer input. Previous implementation relied on the UnaryLayer kABS implementation which does not support integers. https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_network_definition.html#a77831224c9a72ad02587a56ded93c672 ``` Generally the input must have a floating-point type (or kINT8 as a quantized float), except for the following operations: kSIGN accepts a floating-point or Int32 tensor. kNOT requires a Bool tensor. ``` Fixes # (pytorch#1231) 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) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update - [ ] 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 Signed-off-by: Michael Feliz <michael.feliz@getcruise.com>
@@ -1,13 +1,55 @@ | |||
#include "core/conversion/converters/converters.h" | |||
#include "core/util/prelude.h" | |||
|
|||
#include <torch/torch.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing we use quotations instead of angle brackets for non stdlib includes (bazel convention from a while back)
@@ -1,4 +1,5 @@ | |||
#include <string> | |||
#include <torch/torch.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to use quotes instead of anchor braces?
It seems the lint is failing. Can you try applying lint on the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about the lint we are going to do a sweep of the repo before release, seems like some non conformant code got merged and its been messing up the action for a but
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've fixed the include. In general is there a working development docker that is set up to run torch-tensorrt and the linter? The cudnn and tensorrt dependencies in docker/Dockerfile do not seem to install correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are overhauling the linting system to run as a pre-commit hook after just before this release goes out. The tools should be installable on host through pip
#1223
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use the Dockerfile.docs container for development in container since it most aligns with our internal host environment. The other Dockerfile is mostly for users using already released NGC TRT versions
Adds support for aten::abs with integer input. Previous implementation relied on the UnaryLayer kABS implementation which does not support integers.
https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_network_definition.html#a77831224c9a72ad02587a56ded93c672
Fixes # (#1231)
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)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
This change requires a documentation update
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
Signed-off-by: Michael Feliz michael.feliz@getcruise.com
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: