Add AVX-VNNI-FP16 ISA feature detection and reporting to cpuinfo#415
Open
fbarchard wants to merge 1 commit into
Open
Add AVX-VNNI-FP16 ISA feature detection and reporting to cpuinfo#415fbarchard wants to merge 1 commit into
fbarchard wants to merge 1 commit into
Conversation
Expose AMD Zen 6 / Intel AVX-VNNI-FP16 (`avx_vnni_fp16`) instructions in `pytorch/cpuinfo`: - Add `avx_vnni_fp16` boolean field to `struct cpuinfo_x86_isa` - Add public inline accessor `cpuinfo_has_x86_avx_vnni_fp16(void)` (guarded for 64-bit mode) - Detect support via CPUID Leaf 0x7, Sub-leaf 0x1 (ECX = 1), EAX bit 1 (`0x00000002`) - Report `AVX_VNNI_FP16` support in `isa-info` tool
JakeStevens
reviewed
Jul 14, 2026
| * AVX_VNNI_FP16 instructions: | ||
| * - AMD/Intel: eax[bit 1] in structured feature info (ecx = 1). | ||
| */ | ||
| isa.avx_vnni_fp16 = avx_regs && !!(structured_feature_info1.eax & UINT32_C(0x00000002)); |
There was a problem hiding this comment.
IIUC this seems to map to:
X86_FEATURE_SM3
https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/cpufeatures.h
Contributor
Author
There was a problem hiding this comment.
Good catch. SM3 is for SHA-256 crypto. Its not clear there is a dedicated cpuid for this.
For evex encoding AVX512 FP16 can be used for now.
For avx2 it is unclear if/how AVX-VNNI-FP16 detect will be done.
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.
Expose AMD Zen 6 / Intel AVX-VNNI-FP16 (
avx_vnni_fp16) instructions inpytorch/cpuinfo:avx_vnni_fp16boolean field tostruct cpuinfo_x86_isacpuinfo_has_x86_avx_vnni_fp16(void)(guarded for 64-bit mode)0x00000002)AVX_VNNI_FP16support inisa-infotool