Add floating-point routines to SVE microbenchmark#5043
Open
ylpoonlg wants to merge 4 commits intodotnet:mainfrom
Open
Add floating-point routines to SVE microbenchmark#5043ylpoonlg wants to merge 4 commits intodotnet:mainfrom
ylpoonlg wants to merge 4 commits intodotnet:mainfrom
Conversation
* FastDivision * MultiplyPow2 * FP64Overflow * Exponent
Contributor
There was a problem hiding this comment.
Pull request overview
Adds four new floating-point focused SVE microbenchmarks to expand Arm64 SVE coverage in the microbench suite, with project-file gating to avoid compiling these benchmarks on older target frameworks.
Changes:
- Introduce new SVE benchmarks:
FastDivision,MultiplyPow2,Exponent, andFP64Overflow(including Vector128 baselines and SVE/SVE2 variants where applicable). - Add net10.0 target-framework gating to exclude these new benchmarks when building microbenchmarks for TFMs older than net10.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/benchmarks/micro/sve/MultiplyPow2.cs | New benchmark for power-of-two scaling of FP64 (Scalar/Vector128/SVE variants). |
| src/benchmarks/micro/sve/FastDivision.cs | New benchmark for reciprocal-estimate based FP64 division (Scalar/Vector128/SVE variants). |
| src/benchmarks/micro/sve/FP64Overflow.cs | New benchmark for FP64 “overflow” routine including a SVE2 path and exponent side-output. |
| src/benchmarks/micro/sve/Exponent.cs | New benchmark for expf-style routine (Scalar/Vector128/SVE variants). |
| src/benchmarks/micro/MicroBenchmarks.csproj | Excludes these new benchmarks on TFMs < net10.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| Vector<float> invln2Vec = new Vector<float>(d[2]); | ||
| Vector<float> shiftVec = new Vector<float>(d[8]); | ||
| Vector<float> ln2hiVec = new Vector<float>(d[7]); | ||
| Vector<float> constVec = Sve.LoadVector(Sve.CreateTrueMaskSingle(), &d[3]); |
| Vector128<float> c3Vec = Vector128.Create(d[7]); | ||
| Vector128<float> c4Vec = Vector128.Create(d[8]); | ||
|
|
||
| for (; i < Size - 4; i += 4) |
Comment on lines
+97
to
+98
| // Iteratively refine the estimation by multiplying the reicrocal step. | ||
| Vector128<double> stp2; |
| // Estimate the reciprocal of 1/input2Vec. | ||
| Vector<double> input2VecInv = Sve.ReciprocalEstimate(input2Vec); | ||
|
|
||
| // Iteratively refine the estimation by multiplying the reicrocal step. |
Comment on lines
+257
to
+263
| <!-- Remove Sve2 microbenchmarks when running on net versions < 10.0 --> | ||
| <ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))"> | ||
| <Compile Remove="sve\Exponent.cs" /> | ||
| <Compile Remove="sve\FP64Overflow.cs" /> | ||
| <Compile Remove="sve\FastDivision.cs" /> | ||
| <Compile Remove="sve\MultiplyPow2.cs" /> | ||
| </ItemGroup> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 4 floating-point math routines to SVE benchmarks.
Performance Results
Run on Neoverse-V2
FastDivision
MultiplyPow2
FP64Overflow
Exponent
cc @dotnet/arm64-contrib @SwapnilGaikwad @LoopedBard3