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

ttnn.where cannot handle 0-D tensors #16254

Open
jdh8 opened this issue Dec 21, 2024 · 0 comments
Open

ttnn.where cannot handle 0-D tensors #16254

jdh8 opened this issue Dec 21, 2024 · 0 comments
Labels
bug Something isn't working op_cat: eltwise

Comments

@jdh8
Copy link
Contributor

jdh8 commented Dec 21, 2024

Describe the bug
The following cases do not compile because their last argument is a 0-D tensor.
https://github.com/tenstorrent/pytorch2.0_ttnn/blob/7ee612585811e6f6d6718f9f13a1ec4376ab1ce9/torch_ttnn/passes/lowering/to_tt_guard_autogen.py#L108-L115

To Reproduce
Steps to reproduce the behavior:

  1. Go to Test ttnn.where with concerned cases pytorch2.0_ttnn#662
  2. Temporarily empty the blocklist of aten.where.self
diff --git a/torch_ttnn/passes/lowering/to_tt_guard_autogen.py b/torch_ttnn/passes/lowering/to_tt_guard_autogen.py
index e2f6dd8b..3db9c13e 100644
--- a/torch_ttnn/passes/lowering/to_tt_guard_autogen.py
+++ b/torch_ttnn/passes/lowering/to_tt_guard_autogen.py
@@ -106,12 +106,6 @@ aten_native_layer_norm_default_blocklist = [
 ]
 aten_exp_default_blocklist = [["Tensor<[0, 1]> self = ?"], ["Tensor<[]> self = ?"]]
 aten_where_self_blocklist = [
-    ["Tensor<[1, 1, 7, 7]> condition = ?", "Tensor<[1, 12, 7, 7]> self = ?", "Tensor<[]> other = ?"],
-    ["Tensor<[1, 1, 45, 45]> condition = ?", "Tensor<[1, 12, 45, 45]> self = ?", "Tensor<[]> other = ?"],
-    ["Tensor<[1, 1, 1, 46]> condition = ?", "Tensor<[1, 12, 1, 46]> self = ?", "Tensor<[]> other = ?"],
-    ["Tensor<[1, 1, 5, 5]> condition = ?", "Tensor<[1, 16, 5, 5]> self = ?", "Tensor<[]> other = ?"],
-    ["Tensor<[1, 1, 1, 6]> condition = ?", "Tensor<[1, 16, 1, 6]> self = ?", "Tensor<[]> other = ?"],
-    ["Tensor<[1, 1, 256]> condition = ?", "Tensor<[1, 1, 256]> self = ?", "Tensor<[]> other = ?"],
 ]
 aten_empty_memory_format_blocklist = [
     [
  1. See error for each failing test case
Always | FATAL    | Index is out of bounds for the rank, should be between 0 and -1 however is 0

Expected behavior
Correct calculation just like dealing with Tensor<[1]>

Please complete the following environment information:

  • OS: Ubuntu 20.04
  • Version of software: 2edaca7

Additional context
This issue is possibly a duplicate of #15630. All elementwise ops share this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working op_cat: eltwise
Projects
Status: No status
Development

No branches or pull requests

1 participant