TST: fix test_validate_transcendentals skip condition to match SVML dispatch#31333
Open
stratakis wants to merge 1 commit intonumpy:mainfrom
Open
TST: fix test_validate_transcendentals skip condition to match SVML dispatch#31333stratakis wants to merge 1 commit intonumpy:mainfrom
stratakis wants to merge 1 commit intonumpy:mainfrom
Conversation
…ispatch The test was running on machines with FMA3+AVX2 or AVX512F, but the SVML code path requires AVX512_SKX (F+BW+DQ+VL). On machines without AVX512_SKX, the glibc libm scalar fallback is used, which exceeds the 2 ULP tolerance for some float64 cbrt inputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test was running on machines with FMA3+AVX2 or AVX512F, but the SVML code path requires AVX512_SKX (F+BW+DQ+VL). On machines without AVX512_SKX, the glibc libm scalar fallback is used, which exceeds the 2 ULP tolerance for some float64 cbrt inputs.
The failing test was discovered with Python 3.14, when running on an RHEL10.2 instance with Intel Xeon E5-2666 v3 (Haswell), with AVX2+FMA3, but no AVX512 and glibc 2.39.
Tried on my machine which runs Fedora 43, with a Meteor Lake CPU, similarly with AVX2 and FMA3 and no AVX512, glibc 2.42 but it was not reproducible, the glibc implementation stayed within the range of the test.
With the fix the test is correctly skipped in CPUs that have no AVX512.
However, I'm not sure if the original purpose of the test is to check only when SVML is dispatched. Maybe it should skip only the SVML dependent functions (cbrt, tan, etc.) on non AVX512 machines, so they don't fall back to unreliable glibc implementations, while continuing to validate exp and log, which have their own custom NumPy AVX2+FMA3 implementations.
Traceback
AI Disclosure
Claude Code with Opus 4.6 model was used to help investigate the root cause of the test failure by analyzing build logs, CPU feature detection, and the SVML dispatch code path, and ofc to understand the whole issue. Th fix was by me, the comment and commit message were drafted with the help of Claude, and also reviewed by me.