Skip to content

Disabled silu decomposition cast #3677

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

Open
wants to merge 1 commit 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
2 changes: 0 additions & 2 deletions py/torch_tensorrt/dynamo/lowering/_decomposition_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@
aten.select_scatter,
aten.sgn,
aten.sigmoid_backward,
aten.silu,
aten.silu_,
aten.silu_backward,
aten.sinc,
aten.slice_backward,
Expand Down
15 changes: 12 additions & 3 deletions py/torch_tensorrt/dynamo/lowering/_decompositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
_get_decomp_for_cia,
)
from torch._ops import OpOverload

from torch_tensorrt.dynamo._defaults import default_device
from torch_tensorrt.dynamo.conversion.converter_utils import get_positive_dim
from torch_tensorrt.dynamo.utils import to_torch_device
Expand Down Expand Up @@ -253,6 +252,16 @@ def empty_strided_decomposition(*args, **kwargs) -> torch.Tensor: # type: ignor
)


@register_torch_trt_decomposition(
torch.ops.aten.silu.default, registry=TORCH_TRT_DECOMPOSITIONS
)
@register_torch_trt_decomposition(
torch.ops.aten.silu_.default, registry=TORCH_TRT_DECOMPOSITIONS
)
def silu(self: torch.Tensor) -> torch.Tensor:
return self * torch.sigmoid(self)


@register_torch_trt_decomposition(
torch.ops.aten.scatter_add.default, registry=TORCH_TRT_DECOMPOSITIONS
)
Expand Down Expand Up @@ -423,8 +432,8 @@ def instance_norm_decomposition(

@register_torch_trt_decomposition(
torch.ops.aten.full_like, registry=TORCH_TRT_DECOMPOSITIONS
) # type: ignore
def full_like_decomposition(*args, **kwargs) -> torch.Tensor:
)
def full_like_decomposition(*args: Any, **kwargs: Any) -> torch.Tensor:
input = args[0]
shape = args[0].shape
fill_value = args[1]
Expand Down
Loading