Follow-up to #449: allowlist I/O dtype check on both SDPA paths - #454
Follow-up to #449: allowlist I/O dtype check on both SDPA paths#454egilliam-nv wants to merge 3 commits into
Conversation
Address review feedback on NVIDIA#449 (disallow fp32 for unified SDPA): - Check the Q/K/V/O I/O dtype on BOTH the UNIFIED and COMPOSITE paths of verify_sdpa_support_surface_for_implementation, via a shared io_dtypes_within allowlist helper. Unified allows {fp16, bf16, fp8}; composite additionally allows fp32 (matching the fort composite fwd + bwd engines, which support FP32/FP16/BF16/FP8 I/O and nothing else). Neither allows fp64. - Phrase the errors in terms of what IS allowed and reject any other dtype generically, so e.g. fp64 is caught with a sensible message rather than prompting a follow-up bug. - Extend the regression test: fp64 is rejected on the unified and composite paths; fp32 is rejected on unified but accepted on composite/AUTO; fp16/bf16 still build on unified. Also correct the unified dynamic-shape message (dynamic shape is not coming; override shape is the supported mechanism). Verified on A100 (sm80) and H100 (sm90): 7 passed. Signed-off-by: Emil Gilliam <egilliam@nvidia.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)
📝 WalkthroughWalkthroughSDPA support validation now uses a shared I/O dtype helper for COMPOSITE and UNIFIED implementations. Tests add per-port FP64 rejection coverage and expand FP32, FP16, and BF16 behavior checks. ChangesSDPA dtype validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/python/test_sdpa_fp32_rejected.py`:
- Around line 80-84: Update test_fp16_bf16_unified_supported to guard the
UNIFIED FP16/BF16 capability before calling _build_sdpa, skipping when the
current cuDNN/GPU combination lacks support while retaining execution for
supported configurations and both parametrized dtypes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: cf87c277-9062-4f7e-9eb5-dbf2d8067e9c
📒 Files selected for processing (2)
include/cudnn_frontend/node/sdpa_support_surface.htest/python/test_sdpa_fp32_rejected.py
Address CodeRabbit review comments on NVIDIA#449 and NVIDIA#454: - Exercise each Q/K/V/O port independently: override exactly one port with an unsupported dtype (rest FP16) so a check that only looked at Q would be caught. Assert via pytest.raises(match=...) that the rejection is our unified/composite dtype check rather than an incidental one (the intended validation stage). - Don't mask a unified-misroute as a missing composite engine: in the FP32 composite/AUTO test, fail if the rejection came from the unified node; skip only on genuine composite-engine unavailability. - Capability-guard the positive FP16/BF16 unified test: skip when unified SDPA is unsupported on this cuDNN/GPU combo, but still fail if our dtype guard wrongly rejects FP16/BF16. Not addressing the FP8-coverage nitpick: FP8 needs the sdpa_fp8 path with descale/scale tensors, out of scope for this dtype-rejection test. Verified on A100 (sm80) and H100 (sm90): 16 passed. Signed-off-by: Emil Gilliam <egilliam@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/python/test_sdpa_fp32_rejected.py`:
- Around line 123-127: Update the exception handling in
test_sdpa_fp32_rejected.py so a Composite SDPA node rejection is asserted as a
test failure rather than skipped. Before treating the exception as genuine
engine unavailability, assert that its message contains neither the unified-node
rejection nor the composite-engine rejection, preserving skips only for
unrelated unavailability errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b48b4926-e9f2-438f-ab71-8df53674f5b0
📒 Files selected for processing (1)
test/python/test_sdpa_fp32_rejected.py
|
@cudnn-ci-bot run |
|
🚀 Running mirror pipeline Branch: cudnn-gh/pr-454-932bf11 |
Address further CodeRabbit comments on NVIDIA#454: the FP16/BF16-unified and FP32-composite/AUTO positive tests skipped on any GRAPH_NOT_SUPPORTED, which would mask a real regression where our own support-surface allowlist wrongly rejects a dtype it should accept (e.g. composite rejecting FP32, or unified rejecting FP16/BF16). Add a shared _is_dtype_allowlist_rejection() helper (our unified/composite messages both contain "SDPA node supports only"); both positive tests now fail on such a rejection and skip only on a genuine engine/backend unavailability, which surfaces a different message. Verified on A100 (sm80) and H100 (sm90): 16 passed. Signed-off-by: Emil Gilliam <egilliam@nvidia.com>
Follow-up to #449 addressing review feedback. Together with #449 this should fully resolve #424 (which was re-opened because #449 alone wasn't fully satisfactory).
Fixes #424.
Changes
verify_sdpa_support_surface_for_implementation, via a sharedio_dtypes_withinallowlist helper.{fp16, bf16, fp8}.Behavior
AUTO, fp32 auto-selects composite (unchanged from Reject FP32 I/O in the unified SDPA node #449).AUTO, neither path accepts them so auto-select finds no implementation.Testing
test/python/test_sdpa_fp32_rejected.py, addressing the review comments on #449/#454:Verified on A100 (sm80) and H100 (sm90): 16 passed.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests