Skip to content

Minor fix - check for DTensor on igpu platform #3531

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

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions py/torch_tensorrt/dynamo/backend/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
repair_input_aliasing,
)
from torch_tensorrt.dynamo.utils import (
is_tegra_platform,
parse_dynamo_kwargs,
prepare_inputs,
set_log_level,
Expand Down Expand Up @@ -80,10 +81,14 @@ def aot_torch_tensorrt_aten_backend(
fw_compiler=_pretraced_backend_autograd,
decompositions=settings_aot_autograd["decompositions"],
)(gm, sample_inputs)
if any(isinstance(tensor, DTensor) for tensor in sample_inputs):
logger.warning(
"It is recommended to run the model with use_distributed_mode_trace = True since there are distributed tensors in the input which is not supported in aot_export_joint_simple"
)

if is_tegra_platform():
from torch.distributed.tensor import DTensor

if any(isinstance(tensor, DTensor) for tensor in sample_inputs):
logger.warning(
"It is recommended to run the model with use_distributed_mode_trace = True since there are distributed tensors in the input which is not supported in aot_export_joint_simple"
)
return _pretraced_backend(gm, sample_inputs, settings, engine_cache)


Expand Down
2 changes: 1 addition & 1 deletion py/torch_tensorrt/dynamo/conversion/_ConversionContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
from torch_tensorrt.dynamo._settings import CompilationSettings
from torch_tensorrt.fx.types import TRTNetwork
from torch_tensorrt.dynamo.types import TRTNetwork


@dataclass
Expand Down
Loading