GPU faults are catchable typed exceptions - #1524
Draft
samhita-alla wants to merge 1 commit into
Draft
Conversation
The backend now classifies GPU and NVSwitch faults into the ExecutionError it hands the SDK: the code becomes one of the gpufault codes, the driver's own sentence is prepended to the message, and the fault travels as typed data on ExecutionError.gpu_fault. Until now all of that arrived as an opaque RuntimeUserError or RuntimeSystemError, so a task that lost a GPU could not tell that apart from any other failure. Add a GPUFaultError family and select it from those codes. One except clause catches every GPU fault, and the xid, severity, gpu_uuid, node and device attributes are there to branch on. The concrete errors keep the kind the backend chose, GPUFaultUserError for a fault the workload caused and GPUFaultSystemError for one that condemned the hardware, which is also what decides whose retry budget paid for it. Attributes come from the typed fault where the failure carries one and from the prepended sentence otherwise, so a failure from a backend that predates the typed field still names the Xid. Reading them never fails the conversion: an unreadable message costs the details, not the error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
samhita-alla
marked this pull request as draft
September 3, 2026 12:34
kumare3
reviewed
Sep 4, 2026
| # message, and it is what the fault attributes are read from when a failure arrives with no typed fault on it, for | ||
| # example from a backend older than the one that added the field. The trailing full stop is matched only where a space | ||
| # or the end of the message follows it, so a PCI bus id keeps its own dots. | ||
| _GPU_FAULT_SENTENCE = re.compile( |
Contributor
There was a problem hiding this comment.
this looks very brittle, i dont think we should create an expectation that we will have this. We can provide this as a helper. Otherwise users will expect we will always come up with this error. but, this cannot be guaranteed
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.
Why
The backend now classifies GPU faults into the failure a task reports: the error code names the fault (GpuXidError, GpuFallenOffBus, GpuEccUncorrectable, GpuRowRemapPending, GpuNvlinkError, GpuGspError), the message leads with the driver's own sentence, and ExecutionError carries a typed gpu_fault with the Xid, severity, GPU UUID and node. Until now the SDK converted all of that into a generic runtime error, so a parent task could only string-match on the code. This makes GPU faults catchable as typed exceptions.
What
Tests
36 new tests: selection for every code under both kinds, catchability of both leaves through the base class, typed-field population including typed values winning over a conflicting sentence, every sentence device shape plus the aggregated-event prefix, unreadable messages, and unchanged fallthrough for OOMKilled, Interrupted, unknown codes and UNKNOWN kind. ruff, mypy and ty clean; the touched test modules pass 187 tests total.
🤖 Generated with Claude Code