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

Light up Utf8Utility.*.cs and Utf16Utility.*.cs with Vector512 code paths. #86119

Open
4 tasks
DeepakRajendrakumaran opened this issue May 11, 2023 · 6 comments
Open
4 tasks
Labels
area-System.Text.Encoding help wanted [up-for-grabs] Good issue for external contributors tenet-performance Performance related issue
Milestone

Comments

@DeepakRajendrakumaran
Copy link
Contributor

DeepakRajendrakumaran commented May 11, 2023

This task is to identify potential opportunities to use Vector512 in these libraries(ASCII/UTF) and add Vector512 paths where possible to further accelerate using SIMD.

@dotnet/avx512-contrib

See below for list of functions which have SIMD paths in them

  • GetPointerToFirstInvalidChar(utf16Utility.Validation.cs)
    Note from Ruihan - The existing implementation has Sse2 code path and Vector128 code path, a Sse2.AddSaturate differentiates these 2 code path. We worked internally to upgrade it with Vector256/Avx2, and Vector512/Avx512 code paths, the performance for Vector256 path was fine but the upgrade was blocked by the performance issue we found on Vector512 path due to the execution unit contention between AddSaturate(VPADDUSW) and ExtractMostSignificantBits(VPMOVB2M), which leads to no performance gain compared against Vector256.

  • GetPointerToFirstInvalidByte(Utf8Utility.Validation.cs)
    Up for grabs for community to work on

  • TranscodeToUtf8(Utf8Utility.Transcoding.cs)
    Up for grabs for community to work on

  • AllBytesInVector128AreAscii(Utf8Utility.cs) , Vector128OrdinalIgnoreCaseAscii(Utf8Utility.cs)-> EqualsIgnoreCaseUtf8_Vector128(Ordinal.Utf8.cs) -> EqualsIgnoreCaseUtf8(Ordinal.Utf8.cs)
    Up for grabs for community to work on

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 11, 2023
@ghost
Copy link

ghost commented May 11, 2023

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

Issue Details

This task is to identify potential opportunities to use Vector512 in these libraries(ASCII/UTF) and add Vector512 paths where possible to further accelerate using SIMD.

@dotnet/avx512-contrib

Author: DeepakRajendrakumaran
Assignees: -
Labels:

area-Meta

Milestone: -

@DeepakRajendrakumaran
Copy link
Contributor Author

@BruceForstall - Can you please link this to #77034

@ghost
Copy link

ghost commented May 11, 2023

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

Issue Details

This task is to identify potential opportunities to use Vector512 in these libraries(ASCII/UTF) and add Vector512 paths where possible to further accelerate using SIMD.

@dotnet/avx512-contrib

Author: DeepakRajendrakumaran
Assignees: -
Labels:

area-Meta, area-System.Text.Encoding, untriaged

Milestone: -

@BruceForstall
Copy link
Member

@BruceForstall - Can you please link this to #77034

Done. Thanks.

@eiriktsarpalis eiriktsarpalis removed the untriaged New issue has not been triaged by the area owner label May 15, 2023
@eiriktsarpalis eiriktsarpalis added this to the Future milestone May 15, 2023
@eiriktsarpalis eiriktsarpalis added the tenet-performance Performance related issue label May 15, 2023
@anthonycanino
Copy link
Contributor

@BruceForstall to better track work we did/plan to do, I have made #89280 which covers the upgrades to Ascii.Utility which some of UTF8 encoding uses.

For this issue, I will go through and identify the upgrades that pertain directly to UTF8.Utility and UTF16.Utility, which will be for .NET 9 release.

@Ruihan-Yin
Copy link
Contributor

For GetPointerToFirstInvalidChar in utf16Utility.Validation.cs,

The existing implementation has Sse2 code path and Vector128 code path, a Sse2.AddSaturate differentiates these 2 code path. We worked internally to upgrade it with Vector256/Avx2, and Vector512/Avx512 code paths, the performance for Vector256 path was fine but the upgrade was blocked by the performance issue we found on Vector512 path due to the execution unit contention between AddSaturate(VPADDUSW) and ExtractMostSignificantBits(VPMOVB2M), which leads to no performance gain compared against Vector256.

@BruceForstall BruceForstall added the help wanted [up-for-grabs] Good issue for external contributors label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Text.Encoding help wanted [up-for-grabs] Good issue for external contributors tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

6 participants