Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Vectorized implementation of Log/Pow/Cbrt/RootN is broken for some inputs #100535

Closed
stephentoub opened this issue Apr 2, 2024 · 3 comments
Closed

Comments

@stephentoub
Copy link
Member

stephentoub commented Apr 2, 2024

(Reported by @michaelgsharp)

Repro:

using System.Numerics.Tensors;

float[] dest = new float[4];

// Non-vectorized
float[] values = [-1, -2, -3];
TensorPrimitives.Pow(values, 3f, dest);
Console.WriteLine($"{dest[0]} {dest[1]} {dest[2]}");

// Vectorized
values = [-1, -2, -3, -4];
TensorPrimitives.Pow(values, 3f, dest);
Console.WriteLine($"{dest[0]} {dest[1]} {dest[2]} {dest[3]}");

prints

-1 -8 -27
NaN NaN NaN NaN
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
See info in area-owners.md if you want to be subscribed.

@stephentoub
Copy link
Member Author

This extends beyond Pow. We have bugs here for Cbrt, Log, Pow, and RootN.

@stephentoub stephentoub changed the title Vectorized implementation of TensorPrimitives.Pow is broken for negative values Vectorized implementation of Log/Pow/Cbrt/RootN is broken for some inputs Apr 29, 2024
@stephentoub
Copy link
Member Author

Closing as this was disabled in the implementation.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 27, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant