Skip to content

Conversation

@airborne12
Copy link
Member

@airborne12 airborne12 commented Jan 12, 2026

Summary

Fix incorrect CPU detection for Intel Emerald Rapids processors (e.g., Intel Xeon Platinum 8575C) where they were misidentified as PRESCOTT (Pentium 4 era) instead of SAPPHIRERAPIDS.

Problem:

  • Intel Xeon Platinum 8575C (model 207 = exmodel 12, model 15) was detected as CORE=PRESCOTT
  • This caused build failures due to missing FMA/AVX2/AVX512 compiler flags
  • Error: always_inline function '_mm256_fmadd_ps' requires target feature 'fma'

Root Cause:

  1. get_corename() in cpuid_x86.c: case 12 (exmodel 12) only handled model 6 (Arrow Lake), missing model 15 (Emerald Rapids)
  2. Missing break statement caused fall-through to case 15 (family 15 = Pentium 4), returning CORE_PRESCOTT
  3. dynamic.c lacked runtime detection support for exmodel 10-12 newer Intel processors

Changes:

  • cpuid_x86.c: Add case 15 (Emerald Rapids) to exmodel 12 switch + add missing break
  • driver/others/dynamic.c: Add runtime detection for:
    • Exmodel 12: Arrow Lake (model 6), Emerald Rapids (model 15)

Test plan

  • Verify build succeeds on Intel Xeon Platinum 8575C
  • Verify CPU is detected as SAPPHIRERAPIDS (or appropriate fallback)
  • Verify no regression on other Intel processors

Problem:
Intel Xeon Platinum 8575C (Emerald Rapids, model 207 = exmodel 12, model 15)
was incorrectly detected as PRESCOTT (Pentium 4 era) instead of SAPPHIRERAPIDS.

Root cause:
1. In get_corename() function, case 12 (exmodel 12) only handled model 6
   (Arrow Lake) but missed model 15 (Emerald Rapids)
2. Missing break statement caused fall-through to case 15 (family 15,
   which is Pentium 4), returning CORE_PRESCOTT incorrectly

Changes:
- cpuid_x86.c: Add case 15 (Emerald Rapids) to exmodel 12 switch and
  add missing break statement
- dynamic.c: Add case 12 with model 15 for runtime detection of
  Emerald Rapids processors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@airborne12 airborne12 force-pushed the fix-emerald-rapids-detection branch from d0f036b to 9f7497f Compare January 12, 2026 14:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes CPU detection for Intel Emerald Rapids processors (e.g., Intel Xeon Platinum 8575C) which were incorrectly identified as PRESCOTT (Pentium 4 era) due to a missing break statement and incomplete model handling. The fix adds proper detection for Emerald Rapids and other recent Intel processors.

Changes:

  • Added Emerald Rapids (model 15) detection in exmodel 12 case
  • Fixed missing break statement after exmodel 12 to prevent fall-through to family 15 (Pentium 4)
  • Added runtime detection for exmodel 10-12 processors (Meteor Lake, Granite Rapids, Raptor Lake, Alder Lake N, Arrow Lake, Emerald Rapids)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cpuid_x86.c Adds case 15 for Emerald Rapids detection and critical break statement to prevent fall-through
driver/others/dynamic.c Adds runtime detection for exmodel 10, 11, and 12 Intel processors with appropriate fallback logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +807 to +817
return NULL;
case 12:
// Emerald Rapids (e.g., Intel Xeon Platinum 8575C, model 207 = exmodel 12, model 15)
if (model == 15) {
if(support_amx_bf16())
return &gotoblas_SAPPHIRERAPIDS;
if(support_avx512_bf16())
return &gotoblas_COOPERLAKE;
if (support_avx512())
return &gotoblas_SKYLAKEX;
if(support_avx2())
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

Model 10 (Meteor Lake) is handled redundantly. It's already included in the check at line 794 (model == 7 || model == 0), but this separate check for model == 10 at line 807 has different behavior - it doesn't check for AVX512 support like line 795 does. This could lead to suboptimal kernel selection for Meteor Lake processors with AVX512 support. Consider removing this redundant check or consolidating the logic.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +808 to +826
case 12:
// Emerald Rapids (e.g., Intel Xeon Platinum 8575C, model 207 = exmodel 12, model 15)
if (model == 15) {
if(support_amx_bf16())
return &gotoblas_SAPPHIRERAPIDS;
if(support_avx512_bf16())
return &gotoblas_COOPERLAKE;
if (support_avx512())
return &gotoblas_SKYLAKEX;
if(support_avx2())
return &gotoblas_HASWELL;
if(support_avx()) {
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
return &gotoblas_SANDYBRIDGE;
} else {
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
return &gotoblas_NEHALEM;
}
}
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The case 12 implementation only handles model 15 (Emerald Rapids) but the corresponding cpuid_x86.c code also handles model 6 (Arrow Lake). The runtime detection should also include a check for model 6 to maintain consistency with the compile-time detection logic.

Copilot uses AI. Check for mistakes.
Comment on lines +811 to +825
if(support_amx_bf16())
return &gotoblas_SAPPHIRERAPIDS;
if(support_avx512_bf16())
return &gotoblas_COOPERLAKE;
if (support_avx512())
return &gotoblas_SKYLAKEX;
if(support_avx2())
return &gotoblas_HASWELL;
if(support_avx()) {
openblas_warning(FALLBACK_VERBOSE, SANDYBRIDGE_FALLBACK);
return &gotoblas_SANDYBRIDGE;
} else {
openblas_warning(FALLBACK_VERBOSE, NEHALEM_FALLBACK);
return &gotoblas_NEHALEM;
}
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

This code block (lines 811-825) is duplicated from case 8, model 15 (lines 734-747). The identical fallback logic appears in multiple places throughout this file. Consider extracting this common detection logic into a helper function to improve maintainability and reduce code duplication.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant