Skip to content

Commit fa33de2

Browse files
author
Wei
authored
Merge pull request #1104 from pytorch/fb-sync-2-wwei6
Refactor the internal codebase from fx2trt_oss to torch_tensorrt
2 parents 916c3de + 7618ac5 commit fa33de2

File tree

118 files changed

+245
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+245
-203
lines changed

docs/_modules/torch_tensorrt/_compile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ <h1>Source code for torch_tensorrt._compile</h1><div class="highlight"><pre>
518518
<span class="c1"># profiling_verbosity=trt.ProfilingVerbosity.DETAILED, #For profile</span>
519519
<span class="p">)</span>
520520
<span class="c1"># For profile</span>
521-
<span class="c1"># from fx2trt_oss.fx.tools.trt_profiler_sorted import profile_trt_module</span>
521+
<span class="c1"># from torch_tensorrt.fx.tools.trt_profiler_sorted import profile_trt_module</span>
522522
<span class="c1"># profile_trt_module(&quot;&quot;, trt_mod, acc_inputs)</span>
523523
<span class="n">trt_mod</span> <span class="o">=</span> <span class="n">TRTModule</span><span class="p">(</span><span class="o">*</span><span class="n">r</span><span class="p">)</span>
524524

py/torch_tensorrt/_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def get_input(self, inputs):
172172
# profiling_verbosity=trt.ProfilingVerbosity.DETAILED, #For profile
173173
)
174174
# For profile
175-
# from fx2trt_oss.fx.tools.trt_profiler_sorted import profile_trt_module
175+
# from torch_tensorrt.fx.tools.trt_profiler_sorted import profile_trt_module
176176
# profile_trt_module("", trt_mod, acc_inputs)
177177
trt_mod = TRTModule(*r)
178178

py/torch_tensorrt/fx/converters/acc_ops_converters.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44
import warnings
55
from typing import cast, Dict, Optional, Sequence, Tuple, Union
66

7-
from ..tracer.acc_tracer import acc_ops
87
import numpy as np
98

109
# @manual=//deeplearning/trt/python:py_tensorrt
1110
import tensorrt as trt
1211
import torch
12+
1313
from ..converter_registry import tensorrt_converter
14+
15+
from ..tracer.acc_tracer import acc_ops
1416
from ..types import * # noqa: F403
15-
from ..utils import (
16-
get_dynamic_dims,
17-
torch_dtype_from_trt,
18-
torch_dtype_to_trt,
19-
)
2017
from torch.fx.immutable_collections import immutable_list
2118
from torch.fx.node import Argument, Target
2219

20+
from ..utils import get_dynamic_dims, torch_dtype_from_trt, torch_dtype_to_trt
21+
2322
from .converter_utils import * # noqa: F403
2423

2524

py/torch_tensorrt/fx/converters/activation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# @manual=//deeplearning/trt/python:py_tensorrt
44
import tensorrt as trt
55
import torch
6+
67
from ..converter_registry import tensorrt_converter
78

89
from .converter_utils import mark_as_int8_layer

py/torch_tensorrt/fx/converters/adaptive_avgpool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# @manual=//deeplearning/trt/python:py_tensorrt
22
import tensorrt as trt
33
import torch
4+
45
from ..converter_registry import tensorrt_converter
56

67
from .converter_utils import extend_mod_attr_to_tuple, mark_as_int8_layer

py/torch_tensorrt/fx/converters/add.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# @manual=//deeplearning/trt/python:py_tensorrt
44
import tensorrt as trt
55
import torch
6+
67
from ..converter_registry import tensorrt_converter
78

89
from .converter_utils import get_dyn_range, mark_as_int8_layer

py/torch_tensorrt/fx/converters/batchnorm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# @manual=//deeplearning/trt/python:py_tensorrt
44
import tensorrt as trt
55
import torch
6+
67
from ..converter_registry import tensorrt_converter
78

89
from .converter_utils import get_dyn_range, mark_as_int8_layer, to_numpy

py/torch_tensorrt/fx/converters/converter_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# @manual=//deeplearning/trt/python:py_tensorrt
88
import tensorrt as trt
99
import torch
10+
from torch.fx.node import Argument, Target
11+
1012
from ..types import (
1113
Shape,
1214
TRTDataType,
@@ -18,7 +20,6 @@
1820
TRTTensor,
1921
)
2022
from ..utils import torch_dtype_from_trt
21-
from torch.fx.node import Argument, Target
2223

2324

2425
def get_trt_plugin(

py/torch_tensorrt/fx/converters/convolution.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy as np
33
import tensorrt as trt
44
import torch
5+
56
from ..converter_registry import tensorrt_converter
67

78
from .converter_utils import (

py/torch_tensorrt/fx/converters/linear.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# @manual=//deeplearning/trt/python:py_tensorrt
22
import tensorrt as trt
33
import torch
4+
45
from ..converter_registry import tensorrt_converter
56

67
from .converter_utils import get_dyn_range, mark_as_int8_layer, to_numpy

0 commit comments

Comments
 (0)