Skip to content
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

removing the fuse distributed ops lowering pass for tegra platforms #3411

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
31 changes: 17 additions & 14 deletions py/torch_tensorrt/dynamo/lowering/passes/_aten_lowering_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import torch
from torch_tensorrt.dynamo._settings import CompilationSettings
from torch_tensorrt.dynamo.utils import is_tegra_platform

from .accumulate_fp32_matmul import accumulate_fp32_matmul
from .constant_folding import constant_fold
Expand All @@ -17,20 +18,22 @@
from .replace_max_pool_with_indices import replace_max_pool_with_indices
from .view_to_reshape import view_to_reshape

ATEN_POST_LOWERING_PASSES = DynamoPassManager.build_from_passlist(
[
remove_input_alias_fixing_clones,
constant_fold,
repair_input_as_output,
fuse_prims_broadcast,
fuse_distributed_ops,
replace_max_pool_with_indices,
lower_scaled_dot_product_attention,
view_to_reshape,
remove_assert_nodes,
accumulate_fp32_matmul,
]
)
pass_list = [
remove_input_alias_fixing_clones,
constant_fold,
repair_input_as_output,
fuse_prims_broadcast,
replace_max_pool_with_indices,
lower_scaled_dot_product_attention,
view_to_reshape,
remove_assert_nodes,
accumulate_fp32_matmul,
]

if not is_tegra_platform():
pass_list.append(fuse_distributed_ops)

ATEN_POST_LOWERING_PASSES = DynamoPassManager.build_from_passlist(pass_list)

ATEN_PRE_LOWERING_PASSES = DynamoPassManager.build_from_passlist(
[
Expand Down
6 changes: 6 additions & 0 deletions py/torch_tensorrt/dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,3 +799,9 @@ def get_output_dtypes(output: Any, truncate_doulbe: bool = False) -> List[dtype]
f"got unexpected type {type(output)}, expected type is a torch.fx.node.Node or a tuple/list of torch.fx.node.Node"
)
return output_dtypes


def is_tegra_platform() -> bool:
if torch.cuda.get_device_capability() in [(8, 7), (7, 2)]:
return True
return False
Loading