docs: add a debugging recipe for localizing a deferred GPU KernelException#18
Draft
haakon-e wants to merge 1 commit into
Draft
docs: add a debugging recipe for localizing a deferred GPU KernelException#18haakon-e wants to merge 1 commit into
haakon-e wants to merge 1 commit into
Conversation
…ption Document CUDA_LAUNCH_BLOCKING plus sync-barrier bisection for a device-side throw that surfaces as a CUDA.KernelException with no kernel or line.
haakon-e
force-pushed
the
he/gpu-exception-localization
branch
from
July 16, 2026 00:31
b248242 to
0800787
Compare
Member
Author
|
@dennisYatunin could you have a quick look here if these suggestions seem sufficiently generic and useful in your view? As always, things can be improved and expanded upon in the future. |
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.
What
Adds a recipe to
docs/dev-guides/workflow/debugging.mdfor localizing a device-sidethrow(aDomainErrorfrom an out-of-domainsqrt/log/x^y, a bounds error, aSingularException) that surfaces on the host as a genericCUDA.KernelExceptionwith no kernel name and no device line. A row in the "silently-wrong values" lookup table points to the new section.Why
The exception is deferred: CUDA detects it at the next synchronization, so the host stacktrace names that synchronization point, not the throw, and the named line often contains no transcendental operation at all. Compiling with device line info (
-g2) is not an option here because ptxas rejects the non-ASCII identifiers common in CliMA kernels. The section documents the practical alternative: force a synchronous throw withCUDA_LAUNCH_BLOCKING=1, read the reported line correctly, bisect withClimaComms.@syncbarriers paired with@infomarkers, restart from a crash-proximate checkpoint to keep iterations short, and confirm the candidate site with a floor or clamp.Scope
Documentation only; no source changes. The page lives under the shared
docs/dev-guides/, so the recipe is kept repo-agnostic. No docs build is required (CI covers it).