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

Convert aten.masked_fill.Scalar to ttnn.where #164

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jdh8
Copy link
Contributor

@jdh8 jdh8 commented Sep 6, 2024

Ticket

None but related to #147

Problem description

Convert aten.masked_fill.Scalar(self, mask, value) to ttnn.where(mask, self, value)

What's changed

  • Convert aten.masked_fill.Scalar to ttnn.where
  • Test the conversion

Error messages

There is an issue while converting value: float to a singleton tensor in ttnn. I also tried converting the value tensor to tile layout, but it did not work either.

E       RuntimeError: TT_FATAL @ ../tt_metal/impl/buffers/buffer.cpp:31: size != 0 and page_size != 0
E       info:
E       Buffer size and page size should be larger than 0 bytes!
E       backtrace:
E        --- tt::tt_metal::validate_buffer_size_and_page_size(unsigned long, unsigned long, tt::tt_metal::BufferType const&, tt::tt_metal::TensorMemoryLayout const&, std::__1::optional<tt::tt_metal::ShardSpecBuffer> const&)
E        --- tt::tt_metal::Buffer::Buffer(tt::tt_metal::Device*, unsigned long, unsigned long, tt::tt_metal::BufferType, tt::tt_metal::TensorMemoryLayout, std::__1::optional<tt::tt_metal::ShardSpecBuffer> const&, std::__1::optional<bool>, bool)
E        --- /home/ubuntu/tt-metal/ttnn/ttnn/_ttnn.so(+0xe2ebbe) [0x7f2606cb7bbe]
E        --- tt::tt_metal::tensor_impl::allocate_buffer_on_device(unsigned int, tt::tt_metal::Device*, tt::tt_metal::Shape const&, tt::tt_metal::DataType, tt::tt_metal::Layout, tt::tt_metal::MemoryConfig const&, std::__1::optional<tt::tt_metal::ShardSpecBuffer> const&)
E        --- /home/ubuntu/tt-metal/ttnn/ttnn/_ttnn.so(_ZN2tt8tt_metal11tensor_impl25initialize_data_on_deviceI8bfloat16NS0_15borrowed_buffer6BufferEEENSt3__110shared_ptrINS0_6BufferEEERT0_IT_EPNS0_6DeviceERKNS0_5ShapeENS0_8DataTypeENS0_6LayoutERKNS0_12MemoryConfigERKNS6_8optionalINS0_15ShardSpecBufferEEENSO_INS6_17reference_wrapperINS0_12CommandQueueEEEEE+0x2a) [0x7f2606cb893a]
E        --- /home/ubuntu/tt-metal/ttnn/ttnn/_ttnn.so(+0xe2f8f7) [0x7f2606cb88f7]
E        --- /home/ubuntu/tt-metal/ttnn/ttnn/_ttnn.so(+0xe2f639) [0x7f2606cb8639]

@jdh8 jdh8 self-assigned this Sep 6, 2024
@ayerofieiev-tt
Copy link
Member

@jdh8 , I am not clear on this part of the PR description

There is an issue while converting value: float to a singleton tensor in ttnn. I also tried converting the value tensor to tile layout, but it did not work either.

Does it mean this PR is not ready?
I don't see any checks in the conversion code or tests marked with xfail

@jdh8 jdh8 force-pushed the feature/masked-fill-scalar branch from 515dfa1 to 1184249 Compare September 10, 2024 08:14
@jdh8
Copy link
Contributor Author

jdh8 commented Sep 10, 2024

I marked the failing test with its reason. It should be clear now.

@jdh8 jdh8 force-pushed the feature/masked-fill-scalar branch from 04af87a to 48301b3 Compare September 12, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants