-
Notifications
You must be signed in to change notification settings - Fork 81
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
#15483: Initial setup for binary sfpu ops #15557
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.
Clang-Tidy
found issue(s) with the introduced code (1/1)
BinaryOpType op_type, | ||
const std::optional<tt::tt_metal::DataType> in_dtype = std::nullopt, | ||
const std::optional<tt::tt_metal::DataType> out_dtype = std::nullopt, | ||
const std::optional<ttnn::operations::unary::FusedActivations> fused_activations = std::nullopt, |
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.
the const qualified parameter fused_activations
is copied for each invocation; consider making it a reference
const std::optional<ttnn::operations::unary::FusedActivations> fused_activations = std::nullopt, | |
const std::optional<ttnn::operations::unary::FusedActivations>& fused_activations = std::nullopt, |
BinaryOpType op_type, | ||
const std::optional<tt::tt_metal::DataType> input_dtype, | ||
const std::optional<tt::tt_metal::DataType> output_dtype, | ||
const std::optional<std::vector<UnaryWithParam>> fused_activations, |
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.
the const qualified parameter fused_activations
is copied for each invocation; consider making it a reference
const std::optional<std::vector<UnaryWithParam>> fused_activations, | |
const std::optional<std::vector<UnaryWithParam>>& fused_activations, |
const std::optional<tt::tt_metal::DataType> in_dtype = std::nullopt, | ||
const std::optional<tt::tt_metal::DataType> out_dtype = std::nullopt, | ||
const std::optional<ttnn::operations::unary::FusedActivations> fused_activations = std::nullopt, | ||
const std::optional<ttnn::operations::unary::UnaryWithParam> input_tensor_a_activation = std::nullopt); |
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.
the const qualified parameter input_tensor_a_activation
is copied for each invocation; consider making it a reference
const std::optional<ttnn::operations::unary::UnaryWithParam> input_tensor_a_activation = std::nullopt); | |
const std::optional<ttnn::operations::unary::UnaryWithParam>& input_tensor_a_activation = std::nullopt); |
const std::optional<tt::tt_metal::DataType> input_dtype, | ||
const std::optional<tt::tt_metal::DataType> output_dtype, | ||
const std::optional<std::vector<UnaryWithParam>> fused_activations, | ||
const std::optional<unary::UnaryWithParam> input_tensor_a_activation) { |
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.
the const qualified parameter input_tensor_a_activation
is copied for each invocation; consider making it a reference
const std::optional<unary::UnaryWithParam> input_tensor_a_activation) { | |
const std::optional<unary::UnaryWithParam>& input_tensor_a_activation) { |
float exponent, | ||
const std::optional<MemoryConfig>& output_mem_config, | ||
std::optional<Tensor> output_tensor) { | ||
return ExecutePower::invoke(DefaultQueueId, input_a, exponent, output_mem_config, output_tensor); |
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.
parameter output_tensor
is passed by value and only copied once; consider moving it to avoid unnecessary copies
return ExecutePower::invoke(DefaultQueueId, input_a, exponent, output_mem_config, output_tensor); | |
return ExecutePower::invoke(DefaultQueueId, input_a, exponent, output_mem_config, std::move(output_tensor)); |
uint32_t exponent, | ||
const std::optional<MemoryConfig>& output_mem_config, | ||
std::optional<Tensor> output_tensor) { | ||
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, output_tensor); |
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.
parameter output_tensor
is passed by value and only copied once; consider moving it to avoid unnecessary copies
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, output_tensor); | |
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, std::move(output_tensor)); |
const Tensor& exponent, | ||
const std::optional<MemoryConfig>& output_mem_config, | ||
std::optional<Tensor> output_tensor) { | ||
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, output_tensor); |
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.
parameter output_tensor
is passed by value and only copied once; consider moving it to avoid unnecessary copies
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, output_tensor); | |
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, std::move(output_tensor)); |
6a3008b
to
a12fbcc
Compare
Ticket
Link to Github Issue #15483
Problem description
Initial setup to test the binary sfpu ops
What's changed
Added program factory and compute kernel for binary sfpu operation
Added test file to check fp32 precision
Overloaded pow tensor-tensor support for testing
Checklist