Repository navigation
Use GPUToolbox's throw overrides on the PoCL back end - #966
Merged
Merged
Conversation
Some of Base's `Rational` helpers format their error message at run time, which can't be compiled for the device: on Julia 1.10 this broke all signed `Rational` arithmetic in kernels on `CPU()`, and on Julia 1.11 negation. GPUToolbox 3.6 provides `throw_overrides`, which throw these errors with a constant message through `Overlays.device_throw`; stack that table, and implement the hook with `@gputhrow` so these exceptions report their type and message like the back end's own quirks.
Contributor
Benchmark resultsCompared with ddab9e372, the merge base. Times are the minimum time of every benchmark. A change is unusual when it exceeds both three times the benchmark's typical change between consecutive runs on the default branch and a minimum per category (performance 3%, latency 5%, applications 3%, other 3%). A benchmark that starts or stops allocating is listed however few the allocations. A single run can still be a fluke, so rerun before drawing conclusions.
All benchmarks
|
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.
Some of Base's
Rationalhelpers format their error message at run time, which can't be compiled for the device. On Julia 1.10,__throw_rational_argerror_typeminis reachable from every signedRationaloperation (*,+,-,//), so any signedRationalarithmetic in a kernel onCPU()failed with anInvalidIRError; on Julia 1.11 the same happened for negation, through__throw_rational_numerator_typemin.GPUToolbox 3.6 provides
Overlays.throw_overrides(JuliaGPU/GPUToolbox.jl#43), which throws these errors with a constant message through theOverlays.device_throwhook (JuliaGPU/GPUToolbox.jl#44). This PR stacks that table under the PoCL back end's method tables and implements the hook with@gputhrow, so the exceptions report their type and message like the back end's own quirks:The new "POCL Rational errors" testset checks
Rationalmultiply-add and negation onCPU(), and the reported exception for a typemin denominator, a typemin numerator, and a directdevice_throwcall.This supersedes the PoCL-only
__throw_rational_argerror_typeminquirk from #962 (fbb0ba7); whichever lands second should drop that quirk.Requires GPUToolbox 3.6.0 (JuliaRegistries/General#175594).