-
Notifications
You must be signed in to change notification settings - Fork 111
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
Some pointwise unary ops return 2-D results from 1-D inputs #12671
Comments
@jdh8 is the input tilized? |
I’m trying to compare implementations of unary ops, for example,
|
I've inspected op implementations in both groups, but I can't find a clear difference in treating 1-D tensors. |
After #13339, |
I made a workaround in the compiler at tenstorrent/pytorch2.0_ttnn#198 because I can't find the root cause. That PR also enables conversion for all rounding ops: |
At the moment we believe that all unary eltwise ops are impacted by this. It sounds like our to_layout is converting to [1[32], 1024] for tiled output instead of the expected shape of [1024, 1[32]] .
@jdh8 can you confirm? @ayerofieiev-tt , if our understanding is correct, this sounds like it is not an eltwise issue. |
@jdh8 , I will keep track of this one. We might have to update ops later, but at this moment this is pretty much blocked by Tensor Layout work |
* Test conversion to `ttnn.floor` with known input variations * Make import global to reduce overhead * Convert `aten.ceil` to `ttnn.ceil` * Try (1066,) with some other univariate functions The results are inconclusive: - `cos` passes - `sqrt` and `floor` fail * Test unary ops with fast and approximate mode * Try squeezing out the extraneous dimension for 1-D tensors * Restore conversion for `aten.remainder.Scalar` * Fix the workaround to squeeze back to 1-D tensors * Implement conversion to `ttnn.round` * Implement conversion to `ttnn.trunc` * Update conversion for `ttnn.round` * Lessen PCC for `ttnn.round` kernel (tenstorrent/tt-metal#13851) * Convert `torch.round` with various decimal places * Update parameters of `ttnn.round` * Restore code wrongly removed when rebasing 1355625 * Update list of pointwise unary ops * Restore general handler for `aten.hardtanh` * Properly test 1-D cases after working around tenstorrent/tt-metal#12671 * Simplify the workaround for tenstorrent/tt-metal#12671 --------- Co-authored-by: Artem Yerofieiev <[email protected]>
@jdh8 @ayerofieiev-tt Is this still an open issue ? If not, can you please close this ? Thanks |
As we found out in tenstorrent/pytorch2.0_ttnn#198, several ops produce (1, N) tensors when (N,) tensors are expected.
Affected ops:
ceil
floor
gelu
rsqrt
sqrt
Spared ops:
cos
erf
exp
The lists above are non-exhaustive (yet). I fired this ticket before keeping trying on other ops because this issue is probably widespread.
The text was updated successfully, but these errors were encountered: