JuliaGPU / JuliaGPU/KernelAbstractions.jl
Error handling/reporting API
- Dominant language
- Julia
- Stars
- 523
- Forks
- 88
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 25
Description
I noticed DiffEqGPU doing a plain `error()` in GPU code: https://github.com/SciML/DiffEqGPU.jl/blob/dddcb594ce054c0677bc1b18fdabca2fc0c2eaa9/src/perform_step/gpu_tsit5_perform_step.jl#L152
That's of course not great, and leads to inscrutable errors:
```
ERROR: a exception was thrown during kernel execution.
Run Julia on debug level 2 for device stack traces.
```
Running on `-g2` doesn't actually help because the `error` function is not inlined, leading to multiple call sites.
KA.jl should probably offer an `@error` and `@assert` macro that display an error message and halt execution. On CUDA.jl the latter may be implemented using `@cuassert` (which has the annoying consequence of breaking CUDA, because it yields a sticky error, so we may not want to).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the GPU call site in DiffEqGPU.jl's src/perform_step/gpu_tsit5_perform_step.jl around line 152 and review how KernelAbstractions.jl currently handles device errors. Compare the proposed @error and @assert behavior with CUDA.jl's @cuassert, including its sticky-error consequence; done means an agreed API and implementation path for displaying messages and halting execution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100