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

Add forward support for PReLU #14940

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add forward support for PReLU #14940

wants to merge 5 commits into from

Conversation

mouliraj-mcw
Copy link
Contributor

@mouliraj-mcw mouliraj-mcw commented Nov 11, 2024

Ticket

Link to Github Issue #8544

Problem description

Currently PReLU is aliased to LeakyRelu which is not correct. It needs to be properly implemented in the eltwise operation.

What's changed

Additional Information

In Torch PReLU, the second input tensor can only have two valid shapes: either a tensor with a single value (1) or a tensor with a size equal to the number of input channels (default is 1). Currently, This implementation only supports cases where it matches the number of channels. Support for a single-value tensor requires additional handling at the low-level kernel.

Checklist

@mouliraj-mcw mouliraj-mcw force-pushed the mouliraj/prelu branch 3 times, most recently from dc0e900 to 5ba2908 Compare November 12, 2024 12:07
Copy link
Contributor

@umadevimcw umadevimcw left a comment

Choose a reason for hiding this comment

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

Can you write a sweep tests as well?

@mouliraj-mcw
Copy link
Contributor Author

mouliraj-mcw commented Nov 12, 2024

Can you write a sweep tests as well?

For PReLU with scalar weights, sweep tests are already in place(Tensor- scalar version). The sweep tests will be updated to cover the tensor API once PReLU is implemented with support for 1D and 0D tensors.

Copy link
Contributor

@Aswinmcw Aswinmcw left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,38 @@
// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

2023 -> 2024

@rdjogoTT
Copy link
Contributor

Can you add this for Blackhole as well?

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.

7 participants