-
Notifications
You must be signed in to change notification settings - Fork 86
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
#10860: Split Conv2dConfig into Compute config #15164
Conversation
91b8981
to
c74f9c3
Compare
@@ -102,8 +102,10 @@ Result conv_transpose2d( | |||
std::array<uint32_t, 2> dilation, | |||
uint32_t groups, | |||
std::optional<const ttnn::Tensor> bias_tensor, | |||
std::optional<const conv2d::Conv2dConfig> conv_config_) { | |||
std::optional<const conv2d::Conv2dConfig> conv_config_, | |||
std::optional<const DeviceComputeKernelConfig> compute_config_) { |
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 would do pass by const ref for compute_config_, not just here but in general
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.
Should conv_config also be pass by const ref?
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 can make this change in a different PR.
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.
Yeah I think there is PR in flight that does this in general
#15187
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 need go over all instances of ttnn.Conv2dConfig() in the code and fixup params.
I see that many of them still accept math_fidelity for example
0728049
to
290ed51
Compare
} | ||
if (conv_config.reallocate_halo_output) { | ||
auto move_output = ttnn::operations::core::reallocate(halo_output, halo_output.memory_config()); | ||
ttnn::operations::core::deallocate(halo_output); |
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.
doesn't reallocate
already deallocate its input?
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'm not certain. From a quick read through of the reallocate implementation, it looks like it does. I have removed the deallocate.
ttnn/ttnn/device.py
Outdated
math_approx_mode=math_approx_mode, | ||
dst_full_sync_en=dst_full_sync_en, | ||
) | ||
else: |
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 think we should check if is_grayskull
instead of defaulting to it.
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.
Done.
fe4219d
to
372d237
Compare
It's a useful utility function that hides creating an object based on device type. If anything we should rename it to something like |
dad837c
to
d08fee1
Compare
Ticket
#10860
Problem description
Conv2dConfig contains Compute kernel specific arguments which should be passed using DeviceComputeKernelConfig
What's changed
Removed compute kernel arguments from Conv2dConfig.
conv2d
takes an additional argument called compute_config. Used pybind to expose helper functions to create DeviceComputeKernelConfig from the model code.Checklist