Skip to content

sdpa: throw cudnnGraphNotSupportedException when no implementation supports the attributes - #633

Open
vedaanta wants to merge 1 commit into
NVIDIA:developfrom
vedaanta:vagarwalla/sdpa-auto-notsupported-exception
Open

sdpa: throw cudnnGraphNotSupportedException when no implementation supports the attributes#633
vedaanta wants to merge 1 commit into
NVIDIA:developfrom
vedaanta:vagarwalla/sdpa-auto-notsupported-exception

Conversation

@vedaanta

@vedaanta vedaanta commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

What

When _auto_select_implementation finds no implementation for the requested SDPA feature combination on the current arch/version, sdpa_internal threw a plain std::runtime_error. Throw cudnnGraphNotSupportedException instead - it subclasses std::runtime_error (existing catch sites keep working) and pybind already maps it to cudnn.cudnnGraphNotSupportedError.

Why

test_sdpa_fp8_fwd_ragged_L0 draws cu_ragged/cu_ragged_mult layouts. On SM90 fp8 there is no implementation for CU_SEQ_LEN inputs (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 framework pytest.fail instead 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.py imports ensure_current_context from cudnn._device, which no longer defines it, so import cudnn fails. Flagging separately.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error reporting for unsupported SDPA configurations by providing a more specific graph support exception.

…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>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 525638e7-6343-4692-b86c-f202f7a0bdb6

📥 Commits

Reviewing files that changed from the base of the PR and between 218eee7 and 96e0cc8.

📒 Files selected for processing (1)
  • include/cudnn_frontend/graph_interface.h

Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The SDPA internal dispatch path now throws cudnnGraphNotSupportedException when no implementation supports the requested configuration.

Changes

SDPA dispatch

Layer / File(s) Summary
Typed unsupported-configuration error
include/cudnn_frontend/graph_interface.h
The unsupported SDPA path now throws cudnnGraphNotSupportedException instead of std::runtime_error.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 96e0c

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: anerudhan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the SDPA exception change when no implementation supports the requested attributes.
Description check ✅ Passed The description clearly explains the change, motivation, compatibility impact, affected tests, and verification results, despite not following every template heading.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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.

2 participants