Skip to content

Report model NOT READY after an unrecoverable CUDA error - #365

Merged
pskiran1 merged 2 commits into
mainfrom
asaraswathi/tri-1817-psirt-nvidia-triton-exposure-to-onnx-runtime-cuda-scatternd
Oct 5, 2026
Merged

pskiran1 merged 2 commits into
mainfrom
asaraswathi/tri-1817-psirt-nvidia-triton-exposure-to-onnx-runtime-cuda-scatternd

Conversation

@akhilraj9

Copy link
Copy Markdown
Contributor

What — After a fatal, unrecoverable CUDA error during inference, the backend marks the instance unhealthy and reports it NOT READY instead of continuing to report READY.

Why — Sticky CUDA errors (illegal address, launch failure, ECC…) corrupt the context so every later request fails, but the backend returns success from Execute and the model keeps reporting READY — orchestrators never restart it, so a fatal GPU error becomes a silent, indefinite outage.

Change (src/onnxruntime.cc) — IsFatalCudaError() classifier; probe the CUDA context after a failed OrtRun and latch an atomic device_healthy_; implement TRITONBACKEND_ModelInstanceReady to return UNAVAILABLE once unhealthy (mirrors python_backend). Healthy path and CPU-only builds untouched.

Verification — Built and run in tritonserver:26.07-py3 on an A10: a fatal CUDA error now flips readiness to NOT READY (was READY before). IsFatalCudaError unit-tested; clang-format clean.

A fatal CUDA error (e.g. an out-of-bounds kernel write that leaves the context
in cudaErrorIllegalAddress) makes an instance unable to serve, yet it kept
reporting READY, so orchestrators never restarted it.

Detect sticky/unrecoverable CUDA errors after a failed run, latch the instance
unhealthy, and report NOT READY via TRITONBACKEND_ModelInstanceReady so the
instance can be restarted.
@greptile-apps

greptile-apps Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Adds health-check mechanism for GPU runtime failures.

The PR appears safe to merge; the previously identified device-assertion gap is closed.

Summary

The PR marks a GPU model instance NOT READY after a fatal CUDA error. Since the previous review, it adds cudaErrorAssert to the fatal-error classifier, addressing the earlier finding.

Reviews (2) · Last reviewed commit: "review: treat cudaErrorAssert as a fatal..."

Comment thread src/onnxruntime.cc Resolved

@whoisj whoisj left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall, I think the change makes sense, but would like cudaErrorAssert addressed.

Comment thread src/onnxruntime.cc Resolved
Comment thread src/onnxruntime.cc Resolved
A device-side assert leaves the CUDA context unusable like the other sticky
errors, so the instance must latch NOT READY on it too.
@akhilraj9
akhilraj9 requested review from mc-nv and whoisj September 28, 2026 07:14
@pskiran1
pskiran1 merged commit 6618967 into main Oct 5, 2026
4 checks passed
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.

4 participants