sdpa: throw cudnnGraphNotSupportedException when no implementation supports the attributes - #633
Conversation
…pports the attributes When _auto_select_implementation finds no implementation for the requested SDPA feature combination on the current arch/version (e.g. CU_SEQ_LEN inputs with the composite path on SM90 fp8, where the unified engines do not apply), sdpa_internal threw a plain std::runtime_error. Python callers then see a generic RuntimeError, and the test framework fails instead of skipping the config; C++ callers cannot distinguish unsupported-graph from real errors. Throw cudnnGraphNotSupportedException (a std::runtime_error subclass, so existing catch sites keep working); pybind already maps it to cudnn.cudnnGraphNotSupportedError, which the tests convert to a skip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe SDPA internal dispatch path now throws ChangesSDPA dispatch
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change classifies unsupported SDPA configurations as a supported-not-available error so callers and tests can handle them appropriately; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What
When
_auto_select_implementationfinds no implementation for the requested SDPA feature combination on the current arch/version,sdpa_internalthrew a plainstd::runtime_error. ThrowcudnnGraphNotSupportedExceptioninstead - it subclassesstd::runtime_error(existing catch sites keep working) and pybind already maps it tocudnn.cudnnGraphNotSupportedError.Why
test_sdpa_fp8_fwd_ragged_L0drawscu_ragged/cu_ragged_multlayouts. On SM90 fp8 there is no implementation forCU_SEQ_LENinputs (the composite path rejects them by design, the unified engines do not cover SM90 fp8), which is a legitimate unsupported configuration - but the generic RuntimeError made the test frameworkpytest.failinstead of skip, so the suite reported 23 hard failures on H100. C++ callers likewise could not distinguish unsupported-graph from a real error.Verification (H100, cuDNN dev build)
-k fp8_fwd_ragged: before = 23 failed / 2 passed / 7 skipped; after = 2 passed / 30 skipped / 0 failed. Numeric failures are unaffected - only the no-implementation path changes type.Note: branch is based on 6c39f8b rather than develop tip because tip (#612) currently has a broken import -
_pygraph.pyimportsensure_current_contextfromcudnn._device, which no longer defines it, soimport cudnnfails. Flagging separately.Summary by CodeRabbit