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

Expose the Sin, Cos, and SinCos methods on the Vector types #104848

Merged
merged 17 commits into from
Jul 19, 2024

Conversation

tannergooding
Copy link
Member

@tannergooding tannergooding commented Jul 13, 2024

This makes additional progress towards #93513

This implementation is more accurate than the naive implementation that TensorPrimitives had been using and correctly handles the full range of inputs. It does still fallback to scalar if any input is greater than 5 million as vectorizing the complex reduction is more involved and I want to handle it separately in .NET 10.

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

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

@tannergooding tannergooding marked this pull request as ready for review July 17, 2024 18:15
Copy link
Member

@michaelgsharp michaelgsharp left a comment

Choose a reason for hiding this comment

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

LGTM

@tannergooding
Copy link
Member Author

This is blocked on the JIT side fix going in (#104935)

@tannergooding
Copy link
Member Author

Noting that the regression is "by design" in that we took an accuracy fix to ensure we were overall consistent with the scalar algorithm

If the input is less then 5 million then we are generally fast and if its less PI / 4 (already reduced) then we are very fast. However, if the input is greater than 5 million we fallback to scalar currently. This is something we can fix, but it was out of scope for .NET 10 since such inputs should be rare.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants