-
Notifications
You must be signed in to change notification settings - Fork 116
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
Simplify autoformat facilities in preparation for removal #17896
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to file issues at op owners to ask for removal to help out here.
ttnn/cpp/ttnn/operations/experimental/auto_format/auto_format.cpp
Outdated
Show resolved
Hide resolved
ttnn::Shape(unpadded_shape), pad_c, pad_n, pad_h, pad_w); | ||
[](const std::array<uint32_t, 4>& unpadded_shape) -> std::vector<uint32_t> { | ||
auto result = | ||
ttnn::operations::experimental::auto_format::AutoFormat::pad_to_tile_shape(ttnn::Shape(unpadded_shape)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd create a standalone function. might be usefull in c++ too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this thing must get removed. tile shape is not constant.. no need for ttnn::operations::experimental::auto_format::AutoFormat
when there is a TensorSpec
ttnn::Shape AutoFormat::pad_to_tile_shape(const ttnn::Shape& unpadded_shape) { | ||
using namespace tt::constants; | ||
auto rank = unpadded_shape.rank(); | ||
TT_ASSERT(rank >= 1, "rank of shape to pad to tile shape must be at least 1."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TT_FATAL might be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, but not changing in this PR.
- just moved from hpp to cpp
- ideally want to remove this func
ttnn/cpp/ttnn/tensor/tensor_ops.cpp
Outdated
@@ -100,6 +100,11 @@ Tensor tensor_to_device( | |||
|
|||
Tensor tensor_cpu(const Tensor& input_tensor, bool blocking, QueueId cq_id) { | |||
ZoneScoped; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can move zonescoped down or graph tracekr up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved down
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments
auto a_pad_shape = ttnn::operations::experimental::auto_format::AutoFormat::pad_to_tile_shape( | ||
temp.get_padded_shape(), false, false, true, true); | ||
auto a_pad_shape = | ||
ttnn::operations::experimental::auto_format::AutoFormat::pad_to_tile_shape(temp.get_padded_shape()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we do something like using ttnn::operations::experimental::auto_format::AutoFormat autoformat and avoid all this long line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aim is to remove, so not changing in this PR yet.
ttnn/cpp/ttnn/operations/experimental/auto_format/auto_format.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a few comments/questions but overall makes sense
Ticket
Link to Github Issue
Problem description
Autoformat is a convoluted mechanism which we want to remove.
But because its convoluted its hard to make in one step.
Want to clean it up a bit as I am trying to better understand how it works.
What's changed
Added comments, removed things which clearly should not be needed.
Checklist