Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8cafccb

Browse files
committedMay 9, 2025·
using torchTRT enum platform
1 parent af33f4a commit 8cafccb

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed
 

‎py/torch_tensorrt/_compile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ def convert_method_to_trt_engine(
526526
raise RuntimeError("Module is an unknown format or the ir requested is unknown")
527527

528528

529-
@needs_cross_compile
530529
def load_cross_compiled_exported_program(file_path: str = "") -> Any:
531530
"""
532531
Load an ExportedProgram file in Windows which was previously cross compiled in Linux

‎py/torch_tensorrt/_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import ctypes
2-
import platform
3-
import sys
41
from typing import Any
52

63
import torch
4+
from torch_tensorrt._enums import Platform
75

86

97
def sanitized_torch_version() -> Any:
@@ -14,12 +12,14 @@ def sanitized_torch_version() -> Any:
1412
)
1513

1614

17-
def check_cross_compile_trt_win_lib():
15+
def check_cross_compile_trt_win_lib() -> bool:
1816
# cross compile feature is only available on linux
1917
# build engine on linux and run on windows
2018
import dllist
2119

22-
if sys.platform.startswith("linux"):
20+
platform = Platform.current_platform()
21+
platform = str(platform).lower()
22+
if platform.startswith("linux"):
2323
loaded_libs = dllist.dllist()
2424
target_lib = "libnvinfer_builder_resource_win.so.*"
2525
if target_lib in loaded_libs:

‎py/torch_tensorrt/dynamo/_compiler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,6 @@ def save_cross_compiled_exported_program(
12141214
logger.debug(f"successfully saved the module for windows at {file_path}")
12151215

12161216

1217-
@needs_cross_compile
12181217
def load_cross_compiled_exported_program(file_path: str = "") -> Any:
12191218
"""
12201219
Load an ExportedProgram file in Windows which was previously cross compiled in Linux

0 commit comments

Comments
 (0)
Please sign in to comment.