Skip to content

Commit 84f14b2

Browse files
fix main test failure bug (#3590)
1 parent cc328e2 commit 84f14b2

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

.github/workflows/linux-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
path: ${{ env.RUNNER_TEST_RESULTS_DIR }}/**/*.xml
156156
summary: true
157157
display-options: fEs
158-
fail-on-empty: false
158+
fail-on-empty: true
159159

160160
- name: Prepare artifacts for upload
161161
working-directory: ${{ inputs.repository }}

py/torch_tensorrt/dynamo/_defaults.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
import pwd
2+
import platform
33
import tempfile
44

55
import torch
@@ -57,8 +57,18 @@
5757
L2_LIMIT_FOR_TILING = -1
5858
USE_DISTRIBUTED_MODE_TRACE = False
5959
OFFLOAD_MODULE_TO_CPU = False
60+
61+
if platform.system() == "Linux":
62+
import pwd
63+
64+
current_user = pwd.getpwuid(os.getuid())[0]
65+
else:
66+
import getpass
67+
68+
current_user = getpass.getuser()
69+
6070
DEBUG_LOGGING_DIR = os.path.join(
61-
tempfile.gettempdir(), pwd.getpwuid(os.getuid())[0], "torch_tensorrt/debug_logs"
71+
tempfile.gettempdir(), f"torch_tensorrt_{current_user}/debug_logs"
6272
)
6373

6474

py/torch_tensorrt/dynamo/conversion/impl/unsqueeze.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ def unsqueeze(
2222
input: TRTTensor,
2323
dim: int,
2424
) -> TRTTensor:
25-
from importlib.metadata import version
25+
from importlib import metadata
2626

27-
if version("tensorrt") < "10.7.0":
27+
from packaging.version import Version
28+
29+
if Version(metadata.version("tensorrt")) < Version("10.7.0"):
2830
logger.warning(
29-
f"IUnsqueezeLayer is supported starting from TensorRT 10.7.0, using the old unsqueeze implementation in the current TensorRT version: {version('tensorrt')}"
31+
f"IUnsqueezeLayer is supported starting from TensorRT 10.7.0, using the old unsqueeze implementation in the current TensorRT version: {metadata.version('tensorrt')}"
3032
)
3133
return unsqueeze_old(ctx, target, source_ir, name, input, dim)
3234
axes = get_trt_tensor(ctx, dim, f"{name}_axes")

py/torch_tensorrt/runtime/_cudagraphs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, compiled_module: torch.nn.Module) -> None:
7171
self.cudagraphs_module: Optional[CudaGraphsTorchTensorRTModule] = None
7272
self.old_module = None
7373

74-
def __enter__(self) -> torch.nn.Module | torch.fx.GraphModule:
74+
def __enter__(self) -> Union[torch.nn.Module, torch.fx.GraphModule]:
7575

7676
if isinstance(self.compiled_module, torch_tensorrt.MutableTorchTensorRTModule):
7777
self.old_module = self.compiled_module.gm
@@ -92,7 +92,7 @@ def __exit__(self, *args: Any) -> None:
9292

9393
def get_cuda_graph_module(
9494
compiled_module: torch.fx.GraphModule,
95-
) -> torch.nn.Module | torch.fx.GraphModule:
95+
) -> Union[torch.nn.Module, torch.fx.GraphModule]:
9696
global _PY_RT_CUDAGRAPHS
9797

9898
num_torch_module = 0

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ def run(self):
429429
"torch_tensorrt.dynamo.conversion.impl.slice",
430430
"torch_tensorrt.dynamo.conversion.impl.unary",
431431
"torch_tensorrt.dynamo.conversion.plugins",
432+
"torch_tensorrt.dynamo.debug",
432433
"torch_tensorrt.dynamo.lowering",
433434
"torch_tensorrt.dynamo.lowering.passes",
434435
"torch_tensorrt.dynamo.partitioning",
@@ -458,6 +459,7 @@ def run(self):
458459
"torch_tensorrt.dynamo.conversion.impl.slice": "py/torch_tensorrt/dynamo/conversion/impl/slice",
459460
"torch_tensorrt.dynamo.conversion.impl.unary": "py/torch_tensorrt/dynamo/conversion/impl/unary",
460461
"torch_tensorrt.dynamo.conversion.plugins": "py/torch_tensorrt/dynamo/conversion/plugins",
462+
"torch_tensorrt.dynamo.debug": "py/torch_tensorrt/dynamo/debug",
461463
"torch_tensorrt.dynamo.lowering": "py/torch_tensorrt/dynamo/lowering",
462464
"torch_tensorrt.dynamo.lowering.passes": "py/torch_tensorrt/dynamo/lowering/passes",
463465
"torch_tensorrt.dynamo.partitioning": "py/torch_tensorrt/dynamo/partitioning",

0 commit comments

Comments
 (0)