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

#15483: Initial setup for binary sfpu ops #15557

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KalaivaniMCW
Copy link
Contributor

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

  • Post commit CI passes
  • Blackhole Post commit (if applicable)
  • Model regression CI testing passes (if applicable)
  • Device performance regression CI testing passes (if applicable)
  • New/Existing tests provide coverage for changes

Copy link
Contributor

@github-actions github-actions bot left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the const qualified parameter fused_activations is copied for each invocation; consider making it a reference

Suggested change
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the const qualified parameter fused_activations is copied for each invocation; consider making it a reference

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the const qualified parameter input_tensor_a_activation is copied for each invocation; consider making it a reference

Suggested change
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
the const qualified parameter input_tensor_a_activation is copied for each invocation; consider making it a reference

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter output_tensor is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter output_tensor is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ performance-unnecessary-value-param ⚠️
parameter output_tensor is passed by value and only copied once; consider moving it to avoid unnecessary copies

Suggested change
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, output_tensor);
return ExecutePower::invoke(DefaultQueueId, input, exponent, output_mem_config, std::move(output_tensor));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants