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

added converter for torch.einsum #571

Open
wants to merge 432 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
432 commits
Select commit Hold shift + click to select a range
3a02f56
Merge pull request #43 from NVIDIA-AI-IOT/batchnorm1d_fix
jaybdub Aug 16, 2019
ecd4893
list hotfix
jaybdub Aug 22, 2019
7a960c6
Merge pull request #47 from NVIDIA-AI-IOT/list_output_hotfix
jaybdub Aug 22, 2019
445081f
removed caffe2 dependency
jaybdub Sep 10, 2019
295961a
Merge pull request #56 from NVIDIA-AI-IOT/pyt1.2
jaybdub Sep 10, 2019
e394a14
consider ceil_mode of torch.nn.MaxPool2d
mt1871 Sep 13, 2019
59e0ec8
registered add for more interfaces
jaybdub Sep 17, 2019
5ad17bc
added additional div interfaces
jaybdub Sep 17, 2019
e951955
added additional mul interfaces
jaybdub Sep 17, 2019
51e0c95
Merge pull request #61 from NVIDIA-AI-IOT/torch_methods
jaybdub Sep 17, 2019
5c41345
added clamp, clamp_min, clamp_max
jaybdub Sep 17, 2019
08fecd3
added clamp tensor
jaybdub Sep 17, 2019
2769c29
added normalize
jaybdub Sep 18, 2019
493515c
Merge pull request #62 from NVIDIA-AI-IOT/normalize
jaybdub Sep 18, 2019
43d1b1a
added test cases for MaxPool2d
mt1871 Sep 18, 2019
d2825e5
Merge pull request #57 from mt1871/fix_maxpool_ceilmode
jaybdub Sep 19, 2019
630194c
added mobilenet_v2 to module tests
jaybdub Sep 25, 2019
81e73d2
Merge pull request #70 from NVIDIA-AI-IOT/mobilenet_v2
jaybdub Sep 25, 2019
f29ff96
added parsed_args
jaybdub Sep 27, 2019
d409f13
added utilities to support normalize
jaybdub Sep 27, 2019
dc547b8
dtype to normalized constants
jaybdub Sep 27, 2019
c429ae7
added avg_pool2d and removed AvgPool2d
jaybdub Sep 27, 2019
5abcbbe
fixed normalize
jaybdub Sep 27, 2019
d47af74
added missing avg_pool2d.py
jaybdub Sep 27, 2019
916e25d
added max_pool2d removed MaxPool2d
jaybdub Sep 27, 2019
100bcdb
fixed arg parsing in avg_pool2d and max_pool2d
jaybdub Sep 27, 2019
46534bd
refactor
jaybdub Sep 29, 2019
83f1765
Merge pull request #73 from NVIDIA-AI-IOT/functional_refactor
jaybdub Sep 29, 2019
05e7022
added split and chunk
jaybdub Sep 30, 2019
d6a3fd5
added shufflenet to module tests
jaybdub Sep 30, 2019
9b616d7
Merge pull request #74 from NVIDIA-AI-IOT/split
jaybdub Sep 30, 2019
a838a19
added permute
jaybdub Sep 30, 2019
7b46e02
fixed permute converter name
jaybdub Sep 30, 2019
c0c89d2
Merge pull request #75 from NVIDIA-AI-IOT/permute
jaybdub Sep 30, 2019
72f0cd7
added trt_ method to get/create/broadcast tensors
jaybdub Oct 1, 2019
0bfe27d
modified normalize to use trt_
jaybdub Oct 1, 2019
5699dcd
fixed trt_ to handle single tenosr outputs
jaybdub Oct 1, 2019
4c21936
updated converters to use trt_ instead of input._trt
jaybdub Oct 1, 2019
9745e31
added __radd__ to support left hand primitives
jaybdub Oct 1, 2019
9bcadbb
added rdiv and radd
jaybdub Oct 1, 2019
3d2fef8
added rdiv, rmul, radd
jaybdub Oct 1, 2019
e69c577
replcaed input._trt with trt_ in interpolate
jaybdub Oct 1, 2019
fec6b22
Merge pull request #80 from NVIDIA-AI-IOT/prepare_broadcastable_tensors
jaybdub Oct 1, 2019
f27aa27
added mnasnet to test
jaybdub Oct 1, 2019
922a0f7
Merge pull request #81 from NVIDIA-AI-IOT/prepare_broadcastable_tensors
jaybdub Oct 1, 2019
f29e1c9
refactored tests
jaybdub Oct 2, 2019
5b1d552
refactored tests
jaybdub Oct 2, 2019
a660786
Merge branch 'extra_tests' of https://github.com/NVIDIA-AI-IOT/torch2…
jaybdub Oct 2, 2019
4852b82
fix missing --include argument in test.py
jaybdub Oct 2, 2019
f6eae5a
Merge pull request #84 from NVIDIA-AI-IOT/extra_tests
jaybdub Oct 2, 2019
7693e81
removed copy(..) from conversion hook
jaybdub Oct 2, 2019
f2c931e
removed copy(..) from conversion hook
jaybdub Oct 2, 2019
bbe7b1d
Merge branch 'py2_fix' of https://github.com/NVIDIA-AI-IOT/torch2trt …
jaybdub Oct 2, 2019
506fb87
handle __div__, __rdiv__ and __idiv__ to support Python2
jaybdub Oct 2, 2019
beccc1a
Merge pull request #11 from narendasan/narendasan/gitignore
jaybdub Oct 2, 2019
c7cb4bd
Merge pull request #10 from narendasan/narendasan/typo_in_readme
jaybdub Oct 2, 2019
c982944
Merge pull request #85 from NVIDIA-AI-IOT/py2_fix
jaybdub Oct 2, 2019
887ca21
Merge branch 'master' into narendasan/custom_dep_locations
jaybdub Oct 2, 2019
6fafa46
removes caffe2 from build
jaybdub Oct 2, 2019
950109b
Merge pull request #12 from narendasan/narendasan/custom_dep_locations
jaybdub Oct 2, 2019
c8b3619
added support for prelu
jaybdub Oct 4, 2019
b962b4d
Merge pull request #88 from NVIDIA-AI-IOT/prelu
jaybdub Oct 4, 2019
9bbf348
added supported unary ops
jaybdub Oct 4, 2019
972a7c7
Merge pull request #89 from NVIDIA-AI-IOT/unary_supported
jaybdub Oct 4, 2019
1c87da6
added max reduce/elementwise
jaybdub Oct 4, 2019
86feae5
added min reduce/elementwise
jaybdub Oct 4, 2019
dfc7483
added sub
jaybdub Oct 4, 2019
601b94e
added pow elementwise
jaybdub Oct 4, 2019
7947855
fixed min/max reduce all
jaybdub Oct 4, 2019
0a3eaee
added prod
jaybdub Oct 4, 2019
16ac488
added sum reduce
jaybdub Oct 4, 2019
95a5849
increment patch
jaybdub Oct 4, 2019
8d00907
separate tensors for test/convert to ensure falsely added constants c…
jaybdub Oct 4, 2019
a6ee9c4
more relu interfaces
jaybdub Oct 4, 2019
28e1700
Merge pull request #90 from NVIDIA-AI-IOT/supported_elementwise
jaybdub Oct 4, 2019
599524b
fixed broadcast shapes, removed final_shapes
jaybdub Oct 4, 2019
f25eaa5
removed all-dim test from max/min, since this cannot be supported by …
jaybdub Oct 4, 2019
59ee834
removed leaf check
jaybdub Oct 4, 2019
d8b43bd
added jetson xavier benchmark
jaybdub Oct 4, 2019
d7d967c
Merge pull request #91 from NVIDIA-AI-IOT/broadcast_fix
jaybdub Oct 4, 2019
9e8753a
added python2 serialization fix (bytes -> bytearray)
jaybdub Oct 4, 2019
713086d
added save_load test
jaybdub Oct 4, 2019
2d373fe
added save/load test
jaybdub Oct 4, 2019
06ccc64
Merge pull request #93 from NVIDIA-AI-IOT/py2_serialization_fix
jaybdub Oct 4, 2019
4b5a3c2
extra ignore
jaybdub Oct 4, 2019
82e694c
Merge pull request #94 from NVIDIA-AI-IOT/ignore
jaybdub Oct 4, 2019
6c403fc
added leaky_relu
jaybdub Oct 4, 2019
11c465c
added elu
jaybdub Oct 4, 2019
e2ebb8e
added selu, softsign, elu
jaybdub Oct 5, 2019
9b3a3c4
added softplus
jaybdub Oct 5, 2019
2cb97a3
softplus, softsign
jaybdub Oct 5, 2019
4046625
Merge pull request #95 from NVIDIA-AI-IOT/activations_supported
jaybdub Oct 5, 2019
384384e
added network->dot graph util method
jaybdub Oct 8, 2019
e0b0e71
added network->dot graph util method
jaybdub Oct 8, 2019
345b561
merged
jaybdub Oct 8, 2019
323f1d3
graphviz module prefix fix
jaybdub Oct 8, 2019
e83730e
fixed Linear w.o bias
jaybdub Oct 20, 2019
7255a24
Merge pull request #125 from jaybdub/linear_no_bias
jaybdub Oct 20, 2019
3fac66b
handle non-existance torch method with existing converter
jaybdub Oct 21, 2019
c76f141
added profiling
jaybdub Oct 21, 2019
ace0abd
added network->dot graph util method
jaybdub Oct 8, 2019
f7dbb96
added network->dot graph util method
jaybdub Oct 8, 2019
84101a9
graphviz module prefix fix
jaybdub Oct 8, 2019
97260f2
handle non-existance torch method with existing converter
jaybdub Oct 21, 2019
0a2c3eb
added profiling
jaybdub Oct 21, 2019
dc620d9
Merge branch 'network_visualization' of https://github.com/NVIDIA-AI-…
jaybdub Oct 21, 2019
7984972
Merge pull request #106 from NVIDIA-AI-IOT/network_visualization
jaybdub Oct 21, 2019
e520dd2
added dummy
jaybdub Oct 28, 2019
5ab1561
pass for Tensor.dim Tensor.size dummy converters
jaybdub Oct 28, 2019
b967c99
incremented patch
jaybdub Oct 28, 2019
53ce056
Merge pull request #138 from NVIDIA-AI-IOT/unsupported_methods
jaybdub Oct 28, 2019
a32e684
fixed upsampling<->interpolate translation
Nov 19, 2019
af56018
reverted changes to fix build
Nov 19, 2019
4da14ed
renamed test nn_scale->upsample_scale_factor2
jaybdub Nov 23, 2019
33af10d
Merge branch 'SrivastavaKshitij-kshitij/upsample_plugin_fix'
jaybdub Nov 23, 2019
112922b
added int8 support
jaybdub Nov 26, 2019
46bb0df
minor refactor/comment fix of DatasetCalibrator
jaybdub Nov 26, 2019
a7c35d5
handle loose dataset types
jaybdub Nov 26, 2019
8e6e475
fixed int8 support for TensorRT 5.0
jaybdub Nov 27, 2019
b8a54ac
fix int8_support python2
jaybdub Nov 27, 2019
f60509b
refactor int8 buffer assignment using zip()
jaybdub Dec 3, 2019
3a05d4a
increment vers
jaybdub Dec 3, 2019
eb54b5f
Merge pull request #168 from NVIDIA-AI-IOT/int8_support
jaybdub Dec 3, 2019
23ac868
added instance norm from track_stats=True
jaybdub Dec 12, 2019
5f30709
instance norm
jaybdub Dec 13, 2019
67ab729
optimize instance norm by merging sqrt inside scale layer
jaybdub Dec 13, 2019
b3e0c08
Merge pull request #193 from NVIDIA-AI-IOT/instance_norm
jaybdub Dec 13, 2019
c374807
added converter / tests for torch.Tensor.__getitem__
jaybdub Dec 14, 2019
1ee2c05
Merge pull request #195 from NVIDIA-AI-IOT/getitem
jaybdub Dec 14, 2019
1a26b54
fixed Linear for N, *, H case
jaybdub Dec 14, 2019
190a84d
Merge pull request #196 from NVIDIA-AI-IOT/linear_fix
jaybdub Dec 14, 2019
8142c6f
fixed permute for list args
jaybdub Dec 17, 2019
07831d6
Merge pull request #206 from NVIDIA-AI-IOT/permute_listarg_fix
jaybdub Dec 17, 2019
72f6ec2
added support for adaptive_max_pool2d using regular pooling
jaybdub Dec 17, 2019
d526b24
Merge pull request #207 from NVIDIA-AI-IOT/adaptive_max_pool2d
jaybdub Dec 17, 2019
c6d047f
update clamp
SnowMasaya Jan 6, 2020
1756aa9
rm idea
SnowMasaya Jan 6, 2020
e22844a
Merge pull request #224 from SnowMasaya/clamp
jaybdub Jan 7, 2020
6be6da4
plugin setup.py
jaybdub Apr 10, 2020
1142079
asdf
jaybdub Apr 28, 2020
b5bb91d
interpolate torch serialization
jaybdub Apr 28, 2020
62a8918
version handling
jaybdub Apr 29, 2020
1ca350b
fix padding issue of 2d transposed conv.
FrogKuma May 20, 2020
fb72cac
added upsample code in converters
Nov 14, 2019
f6a7eaf
added functional <--> nn.module binding for upsample
Nov 15, 2019
3ecd4f5
made changes:
Nov 15, 2019
3c00f09
working upsample with trt6
Nov 15, 2019
558cbff
added F.interpolate converter
Nov 15, 2019
f48ad4b
(WIP), trt version check
Nov 18, 2019
8f63b22
Add 3d convolutions and interpolations
oliver-batchelor Jan 30, 2020
3ebf1b9
Update lots of ops
oliver-batchelor Feb 2, 2020
63e65d4
More opreations
oliver-batchelor Feb 2, 2020
a4f0b52
Remove tools import
oliver-batchelor Feb 16, 2020
393a13d
fixed trt version compatibility for torch2trt.py
May 25, 2020
401be2e
separated trt 7 ops
May 25, 2020
8cb3606
added original ops
May 25, 2020
3ce1371
reverting to default for trt 7
May 25, 2020
af2674c
changed value from 7 to 7.0
May 26, 2020
3c16ea5
added unit test for ConvTranspose2d and fixed an indentation error in…
Jun 4, 2020
512a511
added testcase for commonly used kernel size 4, stride 2, padding 1 c…
jaybdub Jun 4, 2020
a1daf58
Merge branch 'SrivastavaKshitij-transpose_conv2d'
jaybdub Jun 4, 2020
f3881cc
Merge branch 'master' into new_trt_ops
SrivastavaKshitij Jun 4, 2020
b2c8c13
added enabled kwarg to register_converter and add_module_test
jaybdub Jun 9, 2020
5c31892
moved trt7 ops to converters dir
jaybdub Jun 9, 2020
e3f45d3
merged interpolate modules
jaybdub Jun 9, 2020
1f4f69c
format init
jaybdub Jun 9, 2020
229f807
increment minor vers
jaybdub Jun 9, 2020
57c8188
added --plugins to setup
jaybdub Jun 10, 2020
a22e82c
plugins disclaimer to readme
jaybdub Jun 10, 2020
1a5a397
disable interpolate if PyTorch < 1.3
jaybdub Jun 10, 2020
b31611c
fixed interpolate plugin checking
jaybdub Jun 10, 2020
1f66266
Merge pull request #332 from NVIDIA-AI-IOT/SrivastavaKshitij-new_trt_ops
jaybdub Jun 10, 2020
75fd8e2
allowed plugin loading to silent fail
jaybdub Jun 11, 2020
bea0f6a
Merge pull request #337 from NVIDIA-AI-IOT/plugin_silentfail
jaybdub Jun 11, 2020
22e1118
added ONNX conversion alternative to torch2trt
jaybdub Jun 11, 2020
fe76a7b
Merge pull request #338 from NVIDIA-AI-IOT/onnx_alternative
jaybdub Jun 11, 2020
b0a7724
Add requirements.txt
vellamike Jul 2, 2020
2aa01dd
Added install information
vellamike Jul 2, 2020
ed37a06
Update README.md
vellamike Jul 6, 2020
f7ff467
readme tensorrt install tip
jaybdub Jul 8, 2020
d88fcd5
Merge pull request #361 from NVIDIA-AI-IOT/vellamike-update-requirements
jaybdub Jul 8, 2020
f9828cc
added preliminary code for narrow
Aug 25, 2020
5c4ad8f
narrow converter added successfully
Aug 28, 2020
f3fe46c
softmax neg dim
jaybdub Aug 31, 2020
1f1701d
Merge pull request #396 from NVIDIA-AI-IOT/softmax_negdim_fix
jaybdub Aug 31, 2020
63895f0
Merge pull request #393 from SrivastavaKshitij/narrow_converter
jaybdub Aug 31, 2020
d245496
added add_missing_trt_tensors and broadcast_trt_tensors
jaybdub Sep 1, 2020
fb8da9a
bugfix and add
jaybdub Sep 1, 2020
d6e6f3b
add tests
jaybdub Sep 1, 2020
d14c6b7
div
jaybdub Sep 1, 2020
a08e6dc
dimfix
jaybdub Sep 1, 2020
742b3fd
dump converters script
jaybdub Sep 2, 2020
765c3ad
docs
jaybdub Sep 2, 2020
3adbbe1
changelog contributing
jaybdub Sep 2, 2020
3beeae2
docs
jaybdub Sep 2, 2020
422e1e6
typos
jaybdub Sep 2, 2020
4933faf
docs
jaybdub Sep 2, 2020
3ddd70d
expose the batch size of INT8 calibration as parameter, since different
Chujingjun Sep 2, 2020
48eb79e
Merge pull request #397 from NVIDIA-AI-IOT/const_dim_fix
jaybdub Sep 2, 2020
f5fb752
Merge pull request #398 from Chujingjun/master
jaybdub Sep 2, 2020
16492db
dump converters script
jaybdub Sep 2, 2020
88416f9
docs
jaybdub Sep 2, 2020
1a59749
changelog contributing
jaybdub Sep 2, 2020
93abd9f
docs
jaybdub Sep 2, 2020
384ac89
typos
jaybdub Sep 2, 2020
656805b
docs
jaybdub Sep 2, 2020
571cb00
docs
jaybdub Sep 2, 2020
a263fe0
docs build contrib
jaybdub Sep 2, 2020
0655a80
build docs
jaybdub Sep 2, 2020
1474eee
asdf
jaybdub Sep 2, 2020
3d496ae
docs merge
jaybdub Sep 2, 2020
88d8038
merge fixes
jaybdub Sep 2, 2020
5160901
asdf
jaybdub Sep 3, 2020
5aae576
mkdocs
jaybdub Sep 3, 2020
86d9c3a
docs
jaybdub Sep 3, 2020
67de214
contrib plain md
jaybdub Sep 3, 2020
6c0aec7
basic usage
jaybdub Sep 3, 2020
bd2cd11
issues pathfix
jaybdub Sep 3, 2020
50169ef
broken link
jaybdub Sep 3, 2020
62afaf1
release build docs
jaybdub Sep 3, 2020
c9dcd5e
Merge pull request #399 from jaybdub/docs
jaybdub Sep 3, 2020
3efb89d
Reduce precision docs (#400)
jaybdub Sep 3, 2020
4141730
Update reduced_precision.md (#402)
jaybdub Sep 3, 2020
7563770
Update mkdocs.yml
jaybdub Sep 3, 2020
ea835dc
remove ndim referneces to support older pytorch versions (#415)
jaybdub Sep 15, 2020
b0cc8e7
Assert that inputs are contiguous (#418)
alsrgv Sep 18, 2020
a9a6a53
Add layer names (#432)
jaybdub Oct 19, 2020
d1fa6f9
Sandeepkumar skb groupnorm plugin (#437)
jaybdub Nov 4, 2020
adccbf1
Koenvandesande remove duplicate filenames (#448)
jaybdub Nov 17, 2020
81024cc
allow direct method setting to support custom layers (#460)
jaybdub Dec 2, 2020
2b1827e
custom converter to changelog (#462)
jaybdub Dec 2, 2020
033df0c
added expand converter (#487)
jaybdub Jan 13, 2021
3e4ed64
Additional converters for floordiv, mod, ne, and torch::tensor() oper…
meremeev Feb 22, 2021
a5bdd29
added passing of torch2trt_kwargs to conversion context (#482)
jaybdub Feb 25, 2021
e55a7a5
added filter to floordiv to only enable for pytorch 1.6+ (#511)
jaybdub Feb 25, 2021
15da623
increment version to 0.2.0 (#517)
jaybdub Mar 2, 2021
44977a9
Release push docs tagfix (#519)
jaybdub Mar 2, 2021
8100c6a
Update README.md
jaybdub Mar 20, 2021
72c81f9
Create CLA.md
jaybdub Mar 20, 2021
b9d9e73
Functional conv (#535)
jaybdub Mar 25, 2021
8f7f4f7
added contributors page
jaybdub Apr 26, 2021
2d6150a
Added John Welsh to CONTRIBUTORS.md
jaybdub Apr 26, 2021
1dc9ad1
I have read and agree to the Contributor License Agreement as written…
jaybdub Apr 26, 2021
e01279c
Merge pull request #550 from jaybdub/contributors
jaybdub Apr 26, 2021
2653a71
added silu converter
Jun 15, 2021
fb67b42
functional linear converter
Jun 15, 2021
5ee6033
added gelu converter
Jun 15, 2021
ddb3558
added layer_norm converter
Jun 15, 2021
8ce974c
added converter for torch.einsum
Jun 16, 2021
2e4ccd3
einsum
Jun 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
einsum
John Welsh committed Jun 16, 2021
commit 2e4ccd35d6f4973801574731da732ebf18828800
2 changes: 1 addition & 1 deletion torch2trt/converters/__init__.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
from .clamp import *
from .compare import *
from .div import *
from .einsum import *
from .einsum_converter import *
from .expand import *
from .floordiv import *
from .gelu import *
File renamed without changes.
6 changes: 3 additions & 3 deletions torch2trt/torch2trt.py
Original file line number Diff line number Diff line change
@@ -329,7 +329,7 @@ def __enter__(self):
)
)

def __exit__(self, type, val, tb):
def __exit__(self, *args, **kwargs):
self._set_method(self.converter['method_impl'])

def default_input_names(num_inputs):
@@ -396,9 +396,9 @@ def __enter__(self):
ConversionContext._ACTIVE_CONTEXT = self
return self

def __exit__(self, type, val, tb):
def __exit__(self, *args, **kwargs):
for hook in self.hooks:
hook.__exit__(type, val, tb)
hook.__exit__(*args, **kwargs)
ConversionContext._ACTIVE_CONTEXT = None

def add_inputs(self, torch_inputs, names=None):