Repository navigation
Implement device min/max on LLVM versions that can't select llvm.minimum - #1165
Merged
Merged
Conversation
Move compile_offline out of the atomic metadata testset so that other codegen tests can compile for GPUs other than the local one too.
Julia 1.12 lowers Base.min/max on floats to llvm.minimum/maximum, which LLVM only expands for every AMDGPU target since version 19. Since the ocml overrides were removed (#1117), compiling float min/max with Julia 1.12's in-process back-end fails with "Cannot select: fminimum" on most GPUs. Use an explicit comparison with Julia's semantics (NaNs propagate, -0 < +0) there instead. Also extend the tests to cover more special values, Atomix's atomic min/max, and the generated code for other GPUs and back-ends. Fixes #1142
luraess
approved these changes
Oct 19, 2026
Contributor
AMDGPU.jl BenchmarksDetails
This comment was automatically generated by workflow using github-action-benchmark. |
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.
Re-lands the part of #1148 that never reached main: #1148 was merged into its stacked base branch after that branch had already been merged.
#1117 already removed the NaN-ignoring ocml min/max overrides, so with Julia 1.13 and the external back-end, device
min/maxon floats match the host. But Julia 1.12 lowers them tollvm.minimum/llvm.maximum, which its in-process LLVM 18 can't select on most GPUs ("Cannot select: fminimum"). This adds an explicit comparison-based implementation for LLVM < 19, and #1148's tests: more special values and Atomix's atomic min/max on the device, and codegen checks for gfx90a/gfx942/gfx1200 with both back-ends.Tested locally on gfx1036 (
core/codegenanddevice/math): 194/194 on Julia 1.10, 206/206 on 1.12, 212/212 on 1.13. Without the fix,core/codegencrashes on 1.12.Fixes #1142