Skip to content

Add AVX-VNNI-FP16 ISA feature detection and reporting to cpuinfo#415

Open
fbarchard wants to merge 1 commit into
pytorch:mainfrom
fbarchard:avx_vnni_fp16
Open

Add AVX-VNNI-FP16 ISA feature detection and reporting to cpuinfo#415
fbarchard wants to merge 1 commit into
pytorch:mainfrom
fbarchard:avx_vnni_fp16

Conversation

@fbarchard

Copy link
Copy Markdown
Contributor

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

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
@meta-cla meta-cla Bot added the cla signed label Jul 13, 2026
Comment thread src/x86/isa.c
* 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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@fbarchard fbarchard Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants