Repository navigation
Use GPUToolbox's shared throw overrides - #1138
Merged
Merged
Conversation
Contributor
Benchmark resultsCompared with f4de21a70, the merge base.
All benchmarks
History: https://juliagpu.org/perf/?pkg=metal |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1138 +/- ##
==========================================
+ Coverage 84.60% 88.94% +4.33%
==========================================
Files 105 105
Lines 9426 9297 -129
==========================================
+ Hits 7975 8269 +294
+ Misses 1451 1028 -423 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 10, 2026
Merged
Julia 1.10 and 1.11 format the messages of the errors that `Rational` throws for a typemin numerator or denominator at run time. That code doesn't compile for Metal: on 1.10, `Rational` negation, or arithmetic that normalizes the sign of a denominator (e.g. `muladd`), crashed LLVM. GPUToolbox 3.6's `throw_overrides` throw these errors with a constant message instead.
GPUToolbox's shared overrides throw through `Overlays.device_throw`, with a constant exception type and message. Implement it like `@gputhrow`, so that these exceptions report their type and message at debug level 1 and above, instead of only that an exception occurred.
christiangnrd
force-pushed
the
tb/gputoolbox-throw
branch
from
November 12, 2026 19:46
8b06197 to
2edaa37
Compare
Member
|
Merging to get CI green. |
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.
Adopts two additions from GPUToolbox v3.6.0:
Overlays.throw_overridesis now stacked under Metal's own method table. On Julia 1.10 and 1.11, some of the exceptions thatRationalarithmetic throws build their message at run time, and that code doesn't compile for Metal. On 1.10,Rationalnegation ormuladdin a kernel crashed Julia inside LLVM. This is the crash seen on the Metal CI for Test multiplication with overflow KernelAbstractions.jl#962.Overlays.device_throwis the hook that those shared overrides throw through. Metal overrides it the same way@gputhrowreports exceptions, so at debug level 1 or higher an exception from a shared override reports its type and message (for exampleArgumentError: invalid rational: denominator can't be typemin). Without the override it would only report that an exception occurred.New tests cover
Rationalarithmetic in kernels and the messages these exceptions report. Without this change they crash Julia 1.10.Requires GPUToolbox v3.6.0 (JuliaRegistries/General#175594).