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

Need broadcast support for ttnn.div #15216

Open
punithsekar opened this issue Nov 19, 2024 · 1 comment
Open

Need broadcast support for ttnn.div #15216

punithsekar opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working mcw_cst tasks done for mcw_cst collaboration petr

Comments

@punithsekar
Copy link
Contributor

Describe the bug
Need broadcast support for ttnn.div.

To Reproduce
Steps to reproduce the behavior:

  1. Run the following code snippet
import torch 
import ttnn
import pytest

@pytest.mark.parametrize("device_params", [{"l1_small_size": 24576}], indirect=True)
def test_div(device):
    a=torch.randn(3,1)
    a_ttnn=ttnn.from_torch(a,layout=ttnn.TILE_LAYOUT,device=device)
    b=torch.randn(1,2)
    torch_output=a/b # output_shape = [3,2]
    b_ttnn=ttnn.from_torch(b,layout=ttnn.TILE_LAYOUT,device=device)
    ttnn_output=ttnn.div(a_ttnn,b_ttnn)

Expected behavior
To run without any error

Screenshots

   def __call__(self, *function_args, **function_kwargs):
>       return self.function(*function_args, **function_kwargs)
E       RuntimeError: TT_THROW @ ../ttnn/cpp/ttnn/operations/eltwise/binary/device/broadcast_height_multi_core_program_factory.cpp:25: tt::exception
E       info:
E       BinaryOpType cannot be mapped to BcastOpMath
E       backtrace:
E        --- /home/ubuntu/punith/tt-metal/ttnn/ttnn/_ttnn.so(+0x5d7a09) [0x7f5dc8676a09]
E        --- ttnn::operations::binary::BinaryDeviceOperation::BroadcastHeightMultiCore::create(ttnn::operations::binary::BinaryDeviceOperation::operation_attributes_t const&, ttnn::operations::binary::BinaryDeviceOperation::tensor_args_t const&, tt::tt_metal::Tensor&)

Please complete the following environment information:

  • OS: Ubuntu 20.04
  • Device: WH-n150

Additional context
Used in PETR model, in pos2posemb3d method.

@punithsekar punithsekar added bug Something isn't working mcw_cst tasks done for mcw_cst collaboration petr labels Nov 19, 2024
@punithsekar
Copy link
Contributor Author

fyi @saichandax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mcw_cst tasks done for mcw_cst collaboration petr
Projects
None yet
Development

No branches or pull requests

2 participants