Skip to content

Detect device-side exceptions on the host. #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jul 10, 2025

Very WIP.

Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 9.09091% with 30 lines in your changes missing coverage. Please review.

Project coverage is 33.18%. Comparing base (5355310) to head (e2799dd).

Files with missing lines Patch % Lines
src/compiler/exceptions.jl 13.04% 20 Missing ⚠️
src/compiler/execution.jl 0.00% 9 Missing ⚠️
src/compiler/compilation.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #342       +/-   ##
===========================================
- Coverage   78.53%   33.18%   -45.36%     
===========================================
  Files          12       12               
  Lines         671      660       -11     
===========================================
- Hits          527      219      -308     
- Misses        144      441      +297     

☔ View full report in Codecov by Sentry.
📢 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.

@maleadt
Copy link
Member Author

maleadt commented Jul 11, 2025

Seems like this exposes additional bugs in PoCL. Works fine on Intel...

julia> function kernel()
         OpenCL.@println "Will error"
         error("told ya")
         return
       end

julia> cl.platform!("intel")
OpenCL.Platform('Intel(R) OpenCL Graphics' @0x00000000357af420)

julia> @opencl kernel();
Will error

julia> cl.finish(cl.queue());
ERROR: KernelException: exception thrown during kernel execution on device(s) Intel(R) Arc(TM) A770 Graphics
Stacktrace:
 [1] check_exceptions()
   @ OpenCL ~/Julia/pkg/OpenCL/src/compiler/exceptions.jl:48
 [2] finish(q::OpenCL.cl.CmdQueue)
   @ OpenCL.cl ~/Julia/pkg/OpenCL/lib/cl/cmdqueue.jl:65
 [3] top-level scope
   @ REPL[6]:1

julia> cl.platform!("pocl")
OpenCL.Platform('Portable Computing Language' @0x00007fcc25bbcc08)

julia> @opencl kernel();

julia> cl.finish(cl.queue());

@maleadt
Copy link
Member Author

maleadt commented Jul 11, 2025

gpuarrays/random also triggers:

      From worker 13:   error: line 308: OpFunctionCall Argument <id> '136[%state_2]'s type does not match Function <id> '58[%_struct_58]'s parameter type.
      From worker 13:     %213 = OpFunctionCall %void %julia__throw_boundserror_38187 %state_2
      From worker 13:

The state_2 is suspicious there -- maybe the kernel state pass applying its changes twice?

@maleadt maleadt force-pushed the tb/signal_exception branch from b662c70 to e2799dd Compare July 11, 2025 12:22
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