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

Support floating-point exponents for ttnn.pow #13779

Closed
Tracked by #13795
jdh8 opened this issue Oct 14, 2024 · 1 comment · Fixed by #15534
Closed
Tracked by #13795

Support floating-point exponents for ttnn.pow #13779

jdh8 opened this issue Oct 14, 2024 · 1 comment · Fixed by #15534
Assignees
Labels
bug Something isn't working op_cat: eltwise perf for issues tracking performance problems/improvements precision Precision issues pytorch-compiler

Comments

@jdh8
Copy link
Contributor

jdh8 commented Oct 14, 2024

As we found in tenstorrent/pytorch2.0_ttnn#211, ttnn.pow only supports integer exponents. Even if we only need integral support (as current statistics say), we can still optimize current implementation with binary exponentiation.

for (int d = 0; d < 8; d++) {
vFloat in = dst_reg[0];
vFloat result = 1.0f;
for (uint i = 0; i < exponent; i++) {
result *= in;
}
dst_reg[0] = result;
dst_reg++;
}

@jdh8 jdh8 added the bug Something isn't working label Oct 14, 2024
@jdh8 jdh8 added precision Precision issues op_cat: eltwise perf for issues tracking performance problems/improvements and removed community labels Oct 15, 2024
@mouliraj-mcw mouliraj-mcw self-assigned this Nov 25, 2024
@mouliraj-mcw
Copy link
Contributor

Hi @jdh8

  • The pow function with floating-point exponents is already implemented in the composite structure
    I would like some clarification on the requirement here - is it to optimize the current ckernel for pow using binary exponentiation ?

cc: @eyonland

mouliraj-mcw added a commit that referenced this issue Nov 28, 2024
mouliraj-mcw added a commit that referenced this issue Nov 28, 2024
mouliraj-mcw added a commit that referenced this issue Nov 28, 2024
mouliraj-mcw added a commit that referenced this issue Nov 28, 2024
mouliraj-mcw added a commit that referenced this issue Nov 28, 2024
mouliraj-mcw added a commit that referenced this issue Nov 29, 2024
@mouliraj-mcw mouliraj-mcw linked a pull request Dec 2, 2024 that will close this issue
1 task
mouliraj-mcw added a commit that referenced this issue Dec 3, 2024
mouliraj-mcw added a commit that referenced this issue Dec 3, 2024
### Ticket
Link to Github Issue #13779 


### What's changed

- optimised the existing pow implementation with binary exponentiation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working op_cat: eltwise perf for issues tracking performance problems/improvements precision Precision issues pytorch-compiler
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants