File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 9
9
import torch
10
10
import torch .fx
11
11
from torch_tensorrt ._enums import dtype
12
- from torch_tensorrt ._features import ENABLED_FEATURES
12
+ from torch_tensorrt ._features import ENABLED_FEATURES , needs_cross_compile
13
13
from torch_tensorrt ._Input import Input
14
14
from torch_tensorrt .dynamo import _defaults
15
15
from torch_tensorrt .dynamo .runtime ._CudaGraphsTorchTensorRTModule import (
@@ -301,6 +301,7 @@ def compile(
301
301
raise RuntimeError ("Module is an unknown format or the ir requested is unknown" )
302
302
303
303
304
+ @needs_cross_compile
304
305
def cross_compile_for_windows (
305
306
module : torch .nn .Module ,
306
307
file_path : str ,
@@ -525,6 +526,7 @@ def convert_method_to_trt_engine(
525
526
raise RuntimeError ("Module is an unknown format or the ir requested is unknown" )
526
527
527
528
529
+ @needs_cross_compile
528
530
def load_cross_compiled_exported_program (file_path : str = "" ) -> Any :
529
531
"""
530
532
Load an ExportedProgram file in Windows which was previously cross compiled in Linux
Original file line number Diff line number Diff line change 11
11
from torch .fx .node import Target
12
12
from torch_tensorrt ._Device import Device
13
13
from torch_tensorrt ._enums import EngineCapability , dtype
14
+ from torch_tensorrt ._features import needs_cross_compile
14
15
from torch_tensorrt ._Input import Input
15
16
from torch_tensorrt .dynamo import _defaults , partitioning
16
17
from torch_tensorrt .dynamo ._DryRunTracker import (
49
50
logger = logging .getLogger (__name__ )
50
51
51
52
53
+ @needs_cross_compile
52
54
def cross_compile_for_windows (
53
55
exported_program : ExportedProgram ,
54
56
inputs : Optional [Sequence [Sequence [Any ]]] = None ,
@@ -1190,6 +1192,7 @@ def convert_exported_program_to_serialized_trt_engine(
1190
1192
return serialized_engine
1191
1193
1192
1194
1195
+ @needs_cross_compile
1193
1196
def save_cross_compiled_exported_program (
1194
1197
gm : torch .fx .GraphModule ,
1195
1198
file_path : str ,
@@ -1211,6 +1214,7 @@ def save_cross_compiled_exported_program(
1211
1214
logger .debug (f"successfully saved the module for windows at { file_path } " )
1212
1215
1213
1216
1217
+ @needs_cross_compile
1214
1218
def load_cross_compiled_exported_program (file_path : str = "" ) -> Any :
1215
1219
"""
1216
1220
Load an ExportedProgram file in Windows which was previously cross compiled in Linux
You can’t perform that action at this time.
0 commit comments