Skip to content

Add CPUID for AvxVnniInt8 and AvxVnniInt16 - #113956

Merged
tannergooding merged 48 commits into
dotnet:mainfrom
khushal1996:kcm-avxvnniint8-cpuid
Jul 7, 2025
Merged

Add CPUID for AvxVnniInt8 and AvxVnniInt16#113956
tannergooding merged 48 commits into
dotnet:mainfrom
khushal1996:kcm-avxvnniint8-cpuid

Conversation

@khushal1996

@khushal1996khushal1996 commented Mar 27, 2025

Copy link
Copy Markdown
Member

This PR adds support for CPUID for AVX-VNNI-INT8 & AVX-VNNI-INT16 ISAs

This resolves#112586

Design

image
image

The changes are made in a way to enable the 2 ISAs when

  1. Avx10.2 is enabled or
  2. CPUID for both ISAs are enabled

This is w.r.t the discussions done in API proposal #112586

Testing

Note1: Emitter unit tests not ran since they are added and verified along with AVX10.2 PR #111209

Note2: Superpmi results are not accurate since we are adding a new CPUID and it leads to a new jiteeversionguid. Even after changing the jiteeversion manually, superpmi run shows errors and failures based on the old mch files which can be ignored.

Run JIT subtree with AVXVNNIINT* enabled / disabled


AVXVNNIINT* Enabled
image

AVXVNNIINT* disabled
image

@khushal1996

Copy link
Copy Markdown
MemberAuthor

@tannergooding This is first of the 2 PRs needed for AVX VNNI INT* API introduction #112586

Comment threadsrc/coreclr/jit/hwintrinsic.cpp Outdated
Comment threadsrc/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt Outdated
@khushal1996
khushal1996force-pushed the kcm-avxvnniint8-cpuid branch from 141d643 to 98fc970CompareApril 14, 2025 21:40
@khushal1996

Copy link
Copy Markdown
MemberAuthor

@tannergooding@saucecontrol I have added the CPUID, API surface, JIT handling and template tests here.

@tannergooding
tannergooding self-requested a review April 14, 2025 21:44
@tannergoodingtannergooding self-assigned this Apr 14, 2025
Comment threadsrc/coreclr/tools/Common/InstructionSetHelpers.cs Outdated
Comment threadsrc/coreclr/jit/hwintrinsiccodegenxarch.cpp Outdated
Comment threadsrc/coreclr/jit/hwintrinsiccodegenxarch.cpp
Comment threadsrc/native/minipal/cpufeatures.c Outdated

@tannergoodingtannergooding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, minus a couple nits on ways to simplify the diffs.

CC. @dotnet/jit-contrib for secondary review

@EgorBo

Copy link
Copy Markdown
Member

@khushal1996 could you please resolve the merge conflict?

Comment threadsrc/coreclr/jit/emitxarch.cpp
@tannergooding

Copy link
Copy Markdown
Member

Resolved the merge conflicts. I'll get this merged once CI completes

@khushal1996

Copy link
Copy Markdown
MemberAuthor

Thanks @tannergooding for picking this up. Let me know if you want me to take over if the CI fails.

@khushal1996

Copy link
Copy Markdown
MemberAuthor

Thanks for helping with the review and fixes @tannergooding

@tannergooding

Copy link
Copy Markdown
Member

Thanks as well for getting the feature implemented and done @khushal1996. Fixes were just some minor merge conflict fixes from other cleanup/simplifications that had happened

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Aug 7, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Runtime.Intrinsicscommunity-contributionIndicates that the PR has been added by a community memberlinkable-frameworkIssues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add AVX-VNNI-INT8 and AVX-VNNI-INT16 API

5 participants

@khushal1996@tannergooding@EgorBo@saucecontrol@teo-tsirpanis