Fat binary: add MGONGPU_SIMD_LEVEL env-var to override runtime SIMD selection#1087
Open
Fat binary: add MGONGPU_SIMD_LEVEL env-var to override runtime SIMD selection#1087
Conversation
…stFat, cppfat backend, build rules Agent-Logs-Url: https://github.com/madgraph5/madgraph4gpu/sessions/db0d537e-e75b-4d0b-ba4c-b7f11fb41df6 Co-authored-by: oliviermattelaer <33414646+oliviermattelaer@users.noreply.github.com>
…d Parameters_sm per-SIMD compilation, CPPProcess_base_cpp.o Agent-Logs-Url: https://github.com/madgraph5/madgraph4gpu/sessions/db0d537e-e75b-4d0b-ba4c-b7f11fb41df6 Co-authored-by: oliviermattelaer <33414646+oliviermattelaer@users.noreply.github.com>
…nGpuConfig.h Agent-Logs-Url: https://github.com/madgraph5/madgraph4gpu/sessions/db0d537e-e75b-4d0b-ba4c-b7f11fb41df6 Co-authored-by: oliviermattelaer <33414646+oliviermattelaer@users.noreply.github.com>
…election Agent-Logs-Url: https://github.com/madgraph5/madgraph4gpu/sessions/0bd7a4a4-bb24-4bbf-b578-58747cf4f9fa Co-authored-by: oliviermattelaer <33414646+oliviermattelaer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
oliviermattelaer
April 14, 2026 09:11
View session
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 fat binary always auto-selects the highest SIMD tier the CPU supports, with no way to force a lower level at runtime. This makes it impossible to benchmark, e.g., AVX2 vs AVX512 on the same machine without recompiling.
Changes
MatrixElementKernels.cc(CODEGEN template) —detectBestSimd()now readsMGONGPU_SIMD_LEVELbefore falling through to__builtin_cpu_supports()auto-detection:avx512z,avx512y,avx2,sse4,noneWARNINGis printed and auto-detection proceeds (prevents SIGILL)WARNING# Compare SIMD tiers on one machine without recompiling MGONGPU_SIMD_LEVEL=avx512z ./check_cpp.exe -p 65536 1 32 MGONGPU_SIMD_LEVEL=avx2 ./check_cpp.exe -p 65536 1 32 MGONGPU_SIMD_LEVEL=sse4 ./check_cpp.exe -p 65536 1 32