Skip to content

Add Apple M1/M2/M3/M4 Linux MIDR detection#385

Open
fbarchard wants to merge 3 commits intopytorch:mainfrom
fbarchard:add-apple-silicon-linux-midr
Open

Add Apple M1/M2/M3/M4 Linux MIDR detection#385
fbarchard wants to merge 3 commits intopytorch:mainfrom
fbarchard:add-apple-silicon-linux-midr

Conversation

@fbarchard
Copy link
Copy Markdown
Collaborator

@fbarchard fbarchard commented Apr 28, 2026

Fixes #380 by adding cpuinfo_arm_decode_vendor_uarch logic for Apple's implementer 'a' (0x61).

This PR includes MIDR part mappings for:

  • M1: Icestorm / Firestorm (0x022, 0x023, 0x024, 0x025, 0x028, 0x029)
  • M2: Blizzard / Avalanche (0x032, 0x033, 0x034, 0x035, 0x038, 0x039)
  • M3: Sawtooth / Everest (0x042, 0x043, 0x044, 0x045, 0x048, 0x049)
  • M4: Donan Sawtooth / Donan Everest (0x052, 0x053)

These additions allow cpuinfo to correctly detect the microarchitecture of Apple Silicon cores when running on Linux (e.g., Asahi Linux).

fbarchard and others added 2 commits April 28, 2026 13:09
ARM Cortex-A320 (MIDR part 0xD8F) is an ARMv9.2-A efficiency core.
Add its uarch enum and MIDR mapping.

Co-authored-by: Nicolas Pitre <npitre@baylibre.com>
Fixes pytorch#380 by adding cpuinfo_arm_decode_vendor_uarch logic for Apple's implementer 'a' (0x61).
@fbarchard fbarchard changed the title Add Apple M1/M2 Linux MIDR detection Add Apple M1/M2/M3/M4 Linux MIDR detection Apr 28, 2026
Copy link
Copy Markdown
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Thanks, can you rebase now that the #384 is merged and then run clang-format? I can merge after that.

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.

Apple M1 detects as unknown on Linux

2 participants