Case-sensitive core-name check in #6027 disables AMD AVX-512 block-size override
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c
- Bereich
- performance
Rechercherichtung
Beginne mit der Schutzbedingung in kernel/setparam-ref.c ungefähr bei Zeile 2135 und vergleiche die Core-Namen-Zeichenfolgen mit den Namen, die in driver/others/dynamic.c ungefähr bei Zeile 1025 zurückgegeben werden. Das Issue enthält eine minimale Korrektur und eine Reproduktion mit block_probe.c; baue und führe sie mit OPENBLAS_CORETYPE=SkylakeX und Haswell aus. Fertig ist die Arbeit, wenn die Blockgrößen für SkylakeX wiederhergestellt sind und die Haswell-Werte unverändert bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
The core-name guard added by #6027 uses case-sensitive strcmp against lowercase names, while gotoblas_corename() returns mixed-case names. Consequently, the AMD AVX-512 block-size override is skipped even for the intended cores.
This is still present in develop at 40fa0ead64f2:
- Guard in kernel/setparam-ref.c:
"cooperlake","skylakex","sapphirerapids". - Names in driver/others/dynamic.c:
"Cooperlake","SkylakeX","SapphireRapids".
This report concerns block-size initialization. Kernel selection still reports SkylakeX. I have not measured a performance regression or speedup.
Controlled native comparison
Host: AMD Ryzen 5 7500F (Zen 4), Windows 11 x64. GCC 16.2.0 from w64devkit 2.10.1; ILP64, DYNAMIC_ARCH, actual runtime thread count 1.
Three builds used the same source baseline, compiler and options:
- A: #6027's first parent,
78501e395e86efdf9397234f162e9403b363616e. - B: A plus exactly #6027, equivalent to merge commit
e5a25b7afa4f9d40916039ba34b753c6b70039a0. - C: B with only the three string literals corrected to their actual capitalization.
| Build | Haswell DGEMM P/Q | SkylakeX DGEMM P/Q | Haswell access violations / 26 cases |
|---|---|---|---|
| A | 512 / 512 | 512 / 512 | 23 / 26 |
| B | 512 / 128 | 192 / 384 | 0 / 26 |
| C | 512 / 128 | 512 / 512 | 0 / 26 |
Thus #6027 fixes the Haswell crash in this experiment, while the capitalization correction separately restores the intended SkylakeX block sizes and preserves the Haswell fix.
SHA-256 comparison of 3,204 object files found only the five kernel/setparam_*.obj files changed in each transition. The test program object was identical across all three binaries. The only original source file changed was kernel/setparam-ref.c.
Minimal block-size reproduction
Save this as block_probe.c in the source root. It uses internal headers to observe initialization directly:
#include <stdio.h>
#include "common.h"
#include "cblas.h"
extern void gotoblas_dynamic_init(void);
int main(void) {
gotoblas_dynamic_init();
openblas_set_num_threads(1);
printf("core=%s P=%d Q=%d threads=%d\n", openblas_get_corename(),
gotoblas->dgemm_p, gotoblas->dgemm_q, openblas_get_num_threads());
return 0;
}
From a clean source checkout at B, with w64devkit's bin on PATH, the options used in the experiment are below (PowerShell). Run libs and netlib sequentially:
$opts = @(
'BINARY=64', 'DYNAMIC_ARCH=1',
'DYNAMIC_LIST=PRESCOTT NEHALEM SANDYBRIDGE HASWELL SKYLAKEX',
'TARGET=PRESCOTT', 'USE_THREAD=1', 'NUM_THREADS=64', 'USE_OPENMP=0',
'NO_AFFINITY=1', 'NO_SHARED=1', 'NO_LAPACKE=1',
'BUILD_SINGLE=1', 'BUILD_DOUBLE=1', 'INTERFACE64=1',
'COMMON_OPT=-O2 -march=x86-64 -mtune=generic -fno-asynchronous-unwind-tables',
'FCOMMON_OPT=-O2 -march=x86-64 -mtune=generic -fno-asynchronous-unwind-tables -frecursive -fdefault-integer-8 -fallow-argument-mismatch'
)
make -j8 libs @opts
make -j8 netlib @opts
gcc -O2 -march=x86-64 -fno-asynchronous-unwind-tables -I. -DDYNAMIC_ARCH -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DSMP_SERVER -DSMALL_MATRIX_OPT -DMS_ABI block_probe.c libopenblasp-r0.3.34.dev.a -lpthread -lm -o block_probe.exe
$env:OPENBLAS_NUM_THREADS = '1'
$env:OPENBLAS_CORETYPE = 'SkylakeX'
.\block_probe.exe
$env:OPENBLAS_CORETYPE = 'Haswell'
.\block_probe.exe
No OPENBLAS_L2_SIZE override was set for these two runs. The build used the C-translated LAPACK backend. The probe's feature macros must match the library build because it reads gotoblas_t.
On this host, B prints:
core=SkylakeX P=192 Q=384 threads=1
core=Haswell P=512 Q=128 threads=1
Apply the literal-only correction below, rebuild and relink with the same options. C prints:
core=SkylakeX P=512 Q=512 threads=1
core=Haswell P=512 Q=128 threads=1
This reduced probe was also compiled and run against all three experiment libraries.
Candidate correction
- if (strcmp(gotoblas_corename(), "cooperlake") == 0 || strcmp(gotoblas_corename(), "skylakex") == 0 || strcmp(gotoblas_corename(), "sapphirerapids") == 0) {
+ if (strcmp(gotoblas_corename(), "Cooperlake") == 0 || strcmp(gotoblas_corename(), "SkylakeX") == 0 || strcmp(gotoblas_corename(), "SapphireRapids") == 0) {
Additional validation and scope
Each build ran 156 independent-process cases: six configurations (automatic, Haswell, Zen, SkylakeX, Sandybridge, and Haswell with L2 override 2048), each with DGEMM 256×K @ K×256 for K=128,160,176,256,300,340,512,1024 repeated three times, plus symmetric positive-definite DSYEVD at N=300 and 1240.
B and C both passed 156/156. DGEMM was checked against independent scalar dot products, and DSYEVD against an independently computed full AV−VΛ residual. Across passing cases of the three builds, maximum DGEMM absolute error was 1.43e-13 and maximum eigen residual relative to the matrix Frobenius norm was 1.77e-15 (rounded upward).
Automatic dispatch selected SkylakeX; Zen requests mapped to Haswell in this DYNAMIC_LIST. Cooperlake and SapphireRapids were not separate kernels in this build, so their capitalization mismatch is source evidence, not a claim of native testing for those kernels. This was a static native OpenBLAS comparison, not three rebuilt NumPy wheels. No performance claim is made.
Investigation, local patch preparation and test execution were assisted by Codex.
- Vorherrschende Sprache
- C
- Sterne
- 7.7k
- Forks
- 1.7k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus OpenMathLib/OpenBLAS
-
New releaseOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 12/100
OpenMathLib/OpenBLAS#6189 · 10 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug in other software
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
OpenMathLib/OpenBLAS#6173 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
OpenMathLib/OpenBLAS#6152 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
OpenMathLib/OpenBLAS#6151 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
VORTEXM4: s2_usable() runs RDSVL before the SME2 check (SIGILL without SME)Evtl. vergeben @tesch1 hat das vor 8 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
OpenMathLib/OpenBLAS#6150 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in OpenMathLib/OpenBLAS
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
InukaAsith/TwinDesk#84 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
CanadaHonk/porffor#426 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 77/100
raysan5/raylib.com#132 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100