Skip to content

Conversation

@rrwinterton
Copy link
Contributor

this PR is to add new Intel Processors that are not included in the cpuinfo. This includes the detection of Alder Lake, Meteor Lake, Arrow Lake, Lunar Lake and Panther Lake mobile platforms as well as Sapphire Rapids and Granite Rapid Server/Workstations

@meta-cla meta-cla bot added the cla signed label Oct 21, 2025
Changed the processor names to the microarchtecture names for consistency and accuracy.
src/x86/uarch.c Outdated
case 0xBE: // Alder Lake-N
return cpuinfo_uarch_gracemont;
case 0x8F: // Sapphire Rapids (Golden Cove)
return cpuinfo_uarch_golden_cove;
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove - all golden cove can share one return

src/x86/uarch.c Outdated
case 0xBE: // Alder Lake N / Raptor Lake N (Golden Cove)
return cpuinfo_uarch_gracemont;
case 0xAD: // Granite Rapids (Redood Cove)
return cpuinfo_uarch_redwood_cove;
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove. ditto

case 0xB5: // Arrow Lake U
case 0xC5: // Arrow Lake P
case 0xC6: // Arrow Lake S/HX
return cpuinfo_uarch_lion_cove;
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

return "Lion Cove";
case cpuinfo_uarch_cougar_cove:
return "Cougar Cove";
case cpuinfo_uarch_skymont:
Copy link
Collaborator

@fbarchard fbarchard Oct 28, 2025

Choose a reason for hiding this comment

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

hmmm... there are no skymont stand alone soc?
I guess code aiming at lunarlake could check for skymont or lioncove

Removed redundant return for Lunar Lake and adjusted case order.
@fbarchard
Copy link
Collaborator

Needs another reviewer to approve

@GregoryComer
Copy link
Member

@rrwinterton Can you resolve the clang format errors and rebase? I can merge once checks are green. The CMake failures are caused by CMake 4.x dropping support for older versions and should be resolved on the latest main. Thanks!

clang-format job: https://github.com/pytorch/cpuinfo/actions/runs/19049667827/job/54608194604?pr=334

@fbarchard
Copy link
Collaborator

@rrwinterton Can you resolve the clang format errors and rebase? I can merge once checks are green. The CMake failures are caused by CMake 4.x dropping support for older versions and should be resolved on the latest main. Thanks!

clang-format job: https://github.com/pytorch/cpuinfo/actions/runs/19049667827/job/54608194604?pr=334

In your link clang format points to the end of line:

./include/cpuinfo.h:358:64: error: code should be clang-formatted [-Wclang-format-violations]
        /** Intel Golden Cove microarchitecture (Alder Lake P-Core) */
                                                                      ^

Failed on file: ./include/cpuinfo.h
./src/x86/uarch.c:202:49: error: code should be clang-formatted [-Wclang-format-violations]
                                                case 0xBF: // Raptor Lake HX (Golden Cove)
                                                                                          ^
./src/x86/uarch.c:204:63: error: code should be clang-formatted [-Wclang-format-violations]
                                                case 0xBE: // Alder Lake N / Raptor Lake N (Golden Cove)
                                                                                                        ^
./src/x86/uarch.c:216:33: error: code should be clang-formatted [-Wclang-format-violations]
                                                case 0xCC: // Panther Lake 
                                                                          ^

Failed on file: ./src/x86/uarch.c

Do you know specifically if the issue is CR/LF vs NL?
Or the trailing space on Panther Lake?
Or does it want a . (pediod) at the end of each comment?
The code for lunar lake etc is developed on and tested on Windows, so I suspect it is white space/line feeds?

Does cpuinfo provide a script / command to format?
Or is it simply clang-format -i src/x86/uarch.c

@GregoryComer
Copy link
Member

@rrwinterton Can you resolve the clang format errors and rebase? I can merge once checks are green. The CMake failures are caused by CMake 4.x dropping support for older versions and should be resolved on the latest main. Thanks!
clang-format job: https://github.com/pytorch/cpuinfo/actions/runs/19049667827/job/54608194604?pr=334

In your link clang format points to the end of line:

./include/cpuinfo.h:358:64: error: code should be clang-formatted [-Wclang-format-violations]
        /** Intel Golden Cove microarchitecture (Alder Lake P-Core) */
                                                                      ^

Failed on file: ./include/cpuinfo.h
./src/x86/uarch.c:202:49: error: code should be clang-formatted [-Wclang-format-violations]
                                                case 0xBF: // Raptor Lake HX (Golden Cove)
                                                                                          ^
./src/x86/uarch.c:204:63: error: code should be clang-formatted [-Wclang-format-violations]
                                                case 0xBE: // Alder Lake N / Raptor Lake N (Golden Cove)
                                                                                                        ^
./src/x86/uarch.c:216:33: error: code should be clang-formatted [-Wclang-format-violations]
                                                case 0xCC: // Panther Lake 
                                                                          ^

Failed on file: ./src/x86/uarch.c

Do you know specifically if the issue is CR/LF vs NL? Or the trailing space on Panther Lake? Or does it want a . (pediod) at the end of each comment? The code for lunar lake etc is developed on and tested on Windows, so I suspect it is white space/line feeds?

Does cpuinfo provide a script / command to format? Or is it simply clang-format -i src/x86/uarch.c

Yeah, running clang-format -i [path] should be the easiest way.

formatting changes to compile with clang-formatting.
case 0x9C: // Jacobsville
return cpuinfo_uarch_tremont;
case 0xBE: // Alder Lake-N
case 0x8F: // Sapphire Rapids (Golden Cove)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit starting at line 171 is little cores... consider moving to line 170, just after Icelake

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just submitted fix for p-core order and spelling error.

return cpuinfo_uarch_gracemont;
case 0xAA: // Meteor Lake P/M (Redwood Cove)
case 0xAC: // Meteor Lake S (Redwood Cove)
case 0xAD: // Granite Rapids (Redood Cove)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo, should be *Redwood

@dlenski
Copy link
Contributor

dlenski commented Nov 18, 2025

On my laptop with this Lunar Lake CPU, I get the following result.

This appears to be incorrect, because Lunar Lake processors contain a mixture of Lion Cover cores (P-cores) and Skymont (E-cores).

$ ./cpu-info
Packages:
        0: Intel Core Ultra 5 236V
Microarchitectures:
        8x Lion Cove
Cores:
        0: 1 processor (0), Intel Lion Cove
        1: 1 processor (1), Intel Lion Cove
        2: 1 processor (2), Intel Lion Cove
        3: 1 processor (3), Intel Lion Cove
        4: 1 processor (4), Intel Lion Cove
        5: 1 processor (5), Intel Lion Cove
        6: 1 processor (6), Intel Lion Cove
        7: 1 processor (7), Intel Lion Cove
Clusters:
        0: 8 processors (0-7),  0: 8 cores (0-7), Intel Lion Cove
Logical processors (System ID):
        0 (0): APIC ID 0x00000000
        1 (1): APIC ID 0x00000001
        2 (2): APIC ID 0x00000002
        3 (3): APIC ID 0x00000003
        4 (4): APIC ID 0x00000004
        5 (5): APIC ID 0x00000005
        6 (6): APIC ID 0x00000006
        7 (7): APIC ID 0x00000007

@rrwinterton
Copy link
Contributor Author

On my laptop with this Lunar Lake CPU, I get the following result.

This appears to be incorrect, because Lunar Lake processors contain a mixture of Lion Cover cores (P-cores) and Skymont (E-cores).

$ ./cpu-info
Packages:
        0: Intel Core Ultra 5 236V
Microarchitectures:
        8x Lion Cove
Cores:
        0: 1 processor (0), Intel Lion Cove
        1: 1 processor (1), Intel Lion Cove
        2: 1 processor (2), Intel Lion Cove
        3: 1 processor (3), Intel Lion Cove
        4: 1 processor (4), Intel Lion Cove
        5: 1 processor (5), Intel Lion Cove
        6: 1 processor (6), Intel Lion Cove
        7: 1 processor (7), Intel Lion Cove
Clusters:
        0: 8 processors (0-7),  0: 8 cores (0-7), Intel Lion Cove
Logical processors (System ID):
        0 (0): APIC ID 0x00000000
        1 (1): APIC ID 0x00000001
        2 (2): APIC ID 0x00000002
        3 (3): APIC ID 0x00000003
        4 (4): APIC ID 0x00000004
        5 (5): APIC ID 0x00000005
        6 (6): APIC ID 0x00000006
        7 (7): APIC ID 0x00000007

This is because the infrastructure doesn't support threading to do CPUID for hybrid. The way it works right now is it assume non-hybrid cores. I can fix this by adding affinity to the CPUID when called or we could use a table for the microarchitectures but this is less desirable since it isn't guarenteed to be static.

dlenski added a commit to dlenski/cpuinfo that referenced this pull request Nov 19, 2025
@dlenski
Copy link
Contributor

dlenski commented Nov 20, 2025

@rrwinterton wrote:

@dlenski wrote:

On my laptop with this Lunar Lake CPU, I get the following result.
This appears to be incorrect, because Lunar Lake processors contain a mixture of Lion Cover cores (P-cores) and Skymont (E-cores).

This is because the infrastructure doesn't support threading to do CPUID for hybrid. The way it works right now is it assume non-hybrid cores.

Additionally, the x86-specific code doesn't even use a data structure which allows it to store multiple uarchs, even though ARM + RISC-V code do use that.

I've updated that very basic part for x86 in dlenski/cpuinfo@pr-334...x86_multi_uarch

I can fix this by adding affinity to the CPUID when called or we could use a table for the microarchitectures but this is less desirable since it isn't guarenteed to be static.

Agreed. A table would have to be updated for literally every single hybrid SKU in order to not be incorrect.

The only way to do this for hybrid CPUs is to run CPUID on each of the cores and record the uarch for that core: "As the Intel docs say: CPUID, by design, returns different values depending on the core it is executed on. On hybrid cores more of the CPUID leaves will have data that varies,"

dlenski added a commit to dlenski/cpuinfo that referenced this pull request Nov 20, 2025
dlenski added a commit to dlenski/cpuinfo that referenced this pull request Nov 20, 2025
dlenski added a commit to dlenski/cpuinfo that referenced this pull request Nov 21, 2025
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.

4 participants