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

Adding cat, full, permute_copy and relu ops #34

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

nishpoonia
Copy link
Collaborator

Adding cat, full, permute_copy and relu ops

backends/cadence/aot/functions_hifi.yaml Outdated Show resolved Hide resolved
@@ -60,7 +60,7 @@
- op: full.out
kernels:
- arg_meta: null
kernel_name: torch::executor::full_out
kernel_name: impl::HiFi::full_out
Copy link
Owner

Choose a reason for hiding this comment

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

use name space cadence::impl::HiFi::

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -85,7 +85,7 @@
- op: permute_copy.out
kernels:
- arg_meta: null
kernel_name: torch::executor::permute_copy_out
kernel_name: impl::HiFi::permute_copy_out
Copy link
Owner

Choose a reason for hiding this comment

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

use name space cadence::impl::HiFi::

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


constexpr auto name = "full.out";

bool optimized = 0;
Copy link
Owner

Choose a reason for hiding this comment

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

Use bool as true false

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


bool optimized = false;

if (out.scalar_type() == ScalarType::Float)
Copy link
Owner

Choose a reason for hiding this comment

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

Can we use OR (||) here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

num_out_dims,
num_inp_dims);

return out;
Copy link
Owner

Choose a reason for hiding this comment

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

why we need return here I think there is return common to all if else

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

(int)255,
input.numel());
ret_val = 5;

Copy link
Owner

Choose a reason for hiding this comment

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

ret_val = 5; ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

backends/cadence/hifi/operators/op_full.cpp Show resolved Hide resolved
@dijopaul dijopaul merged commit d730ed8 into main Nov 18, 2024
2 of 40 checks passed
dijopaul added a commit that referenced this pull request Nov 28, 2024
* Adding cat, full, permute_copy and relu ops (#34)

* Adding cat, full, permute_copy

* updating relu wrt new ref (#36)

* Temporary memory allocation, replacing mallocs (#38)

* Integrated temporary mem alloc functionality in place of malloc

* Namespace related changes

* Cleanup the main application

* Adding atan2, softmax, clamp and remainder ops (#37)

* Replaced malloc with temp_memory_allocator

---------

Co-authored-by: nishpoonia <[email protected]>
Co-authored-by: Rushi-cad <[email protected]>
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