Skip to content

Use GPUToolbox's throw overrides and report their exceptions - #604

Merged
maleadt merged 2 commits into
mainfrom
tb/gputoolbox-throw
Nov 16, 2026
Merged

maleadt merged 2 commits into
mainfrom
tb/gputoolbox-throw

Conversation

@maleadt

@maleadt maleadt commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

GPUToolbox v3.6.0 adds Overlays.throw_overrides, which replaces Base helpers that format an exception message at run time. GPU compilers can't compile those helpers. On Julia 1.10, they break every kernel that builds a Rational with a negative denominator. On 1.10 and 1.11 they also break any kernel that negates a Rational. This PR does two things:

  • It stacks throw_overrides at the bottom of the method tables for all devices.
  • It implements the Overlays.device_throw hook that those overrides throw through. The hook records the exception type and message in the exception mailbox, as @gputhrow does, so these errors report as, e.g., ArgumentError: invalid rational: denominator can't be typemin and not as an exception of unknown type.

It bumps the GPUToolbox compat to 3.6.

The muladd test is skipped on Intel's CPU runtime, which can't compile the OpSMulExtended that checked Int multiplication emits.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.40%. Comparing base (abb987d) to head (86668a0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
- Coverage   91.02%   90.40%   -0.63%     
==========================================
  Files          18       18              
  Lines        1806     1751      -55     
==========================================
- Hits         1644     1583      -61     
- Misses        162      168       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from tb/ci-intel-core to main November 16, 2026 12:56
Julia 1.10 formats the message of the error that `Rational` throws for a
typemin denominator, and Julia 1.10 and 1.11 that of negating a typemin
numerator, which fails to compile for the device. That breaks every
kernel that constructs a rational with a negative denominator or negates
one. 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. Record both in the exception
mailbox, as `@gputhrow` does, so that these exceptions report their type
and message instead of as an exception of unknown type.
@maleadt
maleadt force-pushed the tb/gputoolbox-throw branch from 3fb4c7e to 86668a0 Compare November 16, 2026 12:56
@maleadt
maleadt merged commit 0b42a74 into main Nov 16, 2026
11 of 15 checks passed
@maleadt
maleadt deleted the tb/gputoolbox-throw branch November 16, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant