Skip to content

Updated slices validations in the compiler #877

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 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions torch_ttnn/passes/lowering/to_tt_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import math
from torch._guards import detect_fake_mode
from torch._subclasses.fake_tensor import unset_fake_temporarily

from torch_ttnn.utils import (
GraphCleanup,
TtnnBfloat16,
Expand Down Expand Up @@ -701,7 +702,7 @@ def reshape_1d(code, args=args, kwargs=kwargs):
[step] = step or [1]
rank = len(input_size)

if step != 1 or dim >= rank:
if dim >= rank:
return None

# Check if no-op, just return the input tensor
Expand Down Expand Up @@ -1152,8 +1153,6 @@ def reshape_1d(code, args=args, kwargs=kwargs):
# slice_scatter could be concat([pre_slice_tensor, src_tensor, post_slice_tensor])
rank = len(tensor_shape)
[step] = step or [1]
if step != 1:
return None

assert dim < rank, f"The slice dim {dim} should be less than rank {rank}"

Expand Down
Loading