Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Add CPU feature detection for Intel AMX (Advanced Matrix Extensions) #22355

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

Open
EwoutH opened this issue Sep 29, 2022 · 2 comments
Open
Labels
01 - Enhancement component: SIMD Issues in SIMD (fast instruction sets) code or machinery

Comments

@EwoutH
Copy link
Contributor

EwoutH commented Sep 29, 2022

Proposed new feature or change:

Add CPU feature detection for Intel's Advanced Matrix Extensions (AMX). On wide CPU cores the Advanced Matrix Extensions have the potential to increase performance manyfold compared to AVX for certain operations.

Feature sets and Detection

Intel AMX consists of 3 feature sets. The AMX-TILE is the base instruction set. For both INT8 and BF16 there are Tile Matrix Multiply (TMUL) units with each an additional instruction set: AMX-INT8 and AMX-BF16.

CPU ID Input CPU ID Output Instruction Set
EAX=07H, ECX=0 EDX[bit 22] AMX-BF16
EAX=07H, ECX=0 EDX[bit 24] AMX-TILE
EAX=07H, ECX=0 EDX[bit 25] AMX-INT8

See https://en.wikichip.org/wiki/x86/amx#Instructions

Development history

Intel AMX was merged into Linux in October 2021 and included in the 5.16 kernel. Support was backported to Ubuntu 22.04.1 LTS in August 2022.

Similar effords

Resources

This enhancement might be similar to #20821, #20552 and #22265.

@seberg
Copy link
Member

seberg commented Sep 30, 2022

Is this to help downstream? It seems to me that the application for NumPy itself would be very narrow (int8 matrix multiplication, which is completely unoptimized right now).

@rgommers rgommers added 01 - Enhancement component: SIMD Issues in SIMD (fast instruction sets) code or machinery labels Oct 3, 2022
@pythonmobile
Copy link

Perhaps we also need support for https://jott.live/markdown/1.5tflop_m1 for M1/M2's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - Enhancement component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

No branches or pull requests

4 participants