Skip to content

Support mixed-form sequence lengths in SDPA forward (cuDNN 9.25+) - #430

Merged
Anerudhan merged 4 commits into
NVIDIA:developfrom
egilliam-nv:feature/cu_seqlens_mixed
Jul 28, 2026
Merged

Support mixed-form sequence lengths in SDPA forward (cuDNN 9.25+)#430
Anerudhan merged 4 commits into
NVIDIA:developfrom
egilliam-nv:feature/cu_seqlens_mixed

Conversation

@egilliam-nv

@egilliam-nv egilliam-nv commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Before submitting

  • I agree to license this contribution under the terms of LICENSE.txt.
  • I ran pre-commit run and committed any formatting changes.

Affected area

  • C++ frontend API or graph construction (SDPA support surface, diagonal band mask)
  • Python API or bindings (SDPA test harness)

Summary

Allow the Q and KV sides of SDPA forward to independently choose their sequence-length representation: per-batch (seq_len_*) or cumulative (cu_seq_len_*). Previously the two forms were mutually exclusive across the whole operation.

  • sdpa_support_surface: validation is now per-side (exactly one form per side; both sides provided together); the paged requirement accepts either form per side; mixed forms are gated on cuDNN 9.25+ in the UNIFIED surface. A has_input helper is hoisted for the presence checks.
  • diagonal_band_mask: the node's metadata seqlen check is relaxed to per-side exclusivity, matching the SDPA rules.
  • Tests: per-side form control in the SDPA test harness (cu_seq_len_sides) plus a deterministic mixed-form test (test_sdpa_mixed_seq_len_forms_L0) with non-uniform per-batch lengths, including bottom-right-causal cases that guard the backend's band-mask alignment derivation.

Why

Paged-attention integrations naturally hold a cumulative Q prefix sum (qo_indptr) alongside per-batch KV lengths. The old same-form-both-sides rule forced them to materialize a KV-side prefix sum purely to satisfy the pairing constraint. Permitting mixed forms removes that unnecessary conversion.

Mixed forms require the per-side sequence-length support added to the cuDNN backend in 9.25, so they are gated on min(compiled, runtime) >= 92500 in the UNIFIED support surface and rejected with a clear error below that.

Related issues

Backend support merged separately (cuDNN backend MRs, internal). Related to #366 (expose cu_seq_len_q/kv on the sdpa_fp8 Python binding).

API and compatibility impact

No public API additions or removals. Purely relaxes an existing validation constraint on the cu_seq_len_* / seq_len_* SDPA inputs; all previously-valid graphs remain valid. New capability (mixed forms) is version-gated to cuDNN 9.25+ and rejected with a clear error below that.

Testing

On H100 (sm90) against a cuDNN 9.27 dev build with the backend support:

  • pytest test/python/test_mhas_v2.py -k mixed_seq_len_forms — 4/4 pass (both mixed directions x {top-left, bottom-right-causal}).
  • pytest test/python/test_sdpa_edge_cases.py — 10/10 pass (no harness regression).
  • pytest test/python/test_mhas_v2.py::test_sdpa_random_fwd_L0 (slice) — 203 passed, 9 skipped.
  • Standalone end-to-end check: non-paged mixed (both directions), and paged ragged-Q + page tables with cu_seq_len_q + seq_len_kv and bottom-right causal, all match the both-per-batch reference.

Below cuDNN 9.25 the mixed-form tests skip via the version gate.

Summary by CodeRabbit

  • Bug Fixes
    • Refined SDPA sequence-length validation to detect conflicts per side (per-batch vs cumulative) with more precise errors.
    • Strengthened padding-mask and paged-attention validation to require consistent sequence-length availability across Q and KV.
    • Improved implementation-compatibility handling for mixed Q/KV sequence-length representations.
  • Tests
    • Added deterministic test coverage for mixed-form sequence lengths (cumulative on Q or KV) across alignment and right-bound scenarios.
  • Documentation
    • Updated Python bindings, operation docs, and sample guidance to clarify cu_seq_len_* rules, mixed-form support, and version/implementation requirements.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

SDPA validation now supports independently selected explicit or cumulative sequence-length forms for Q and KV. Test configuration, tensor allocation, graph construction, version gating, documentation, samples, and parameterized mixed-form coverage are updated accordingly.

Changes

Mixed sequence-length support

Layer / File(s) Summary
Sequence-length validation rules
include/cudnn_frontend/node/diagonal_band_mask.h, include/cudnn_frontend/node/sdpa_support_surface.h
Validation distinguishes Q/KV sequence-length representations, updates padding-mask and paged-attention checks, and enforces implementation-specific cumulative sequence-length constraints.
Per-side test configuration and graph wiring
test/python/sdpa/random_config.py, test/python/sdpa/fp16.py
ExecConfig selects cumulative forms independently for Q and KV, while tensor allocation and forward-graph construction provide the matching inputs.
Deterministic mixed-form coverage
test/python/test_mhas_v2.py
A parameterized test covers Q-only and KV-only cumulative sequence-length cases with diagonal alignment and right-bound variations.
Documentation and sample constraints
docs/operations/Attention.md, python/pygraph/sdpa.cpp, samples/cpp/sdpa/fp16_fwd_with_cu_seq_len.cpp
API documentation and sample constraints describe per-side tensor pairing, exclusivity, padding-mask requirements, implementation requirements, and mixed-form cuDNN version support.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ExecConfig
  participant allocate_tensors
  participant create_forward_graph
  participant SDPA_attributes
  ExecConfig->>allocate_tensors: select Q and KV sequence-length forms
  allocate_tensors->>create_forward_graph: provide explicit or cumulative tensors
  create_forward_graph->>SDPA_attributes: validate mixed-form inputs
  SDPA_attributes-->>create_forward_graph: accept or reject configuration
Loading

Possibly related PRs

  • NVIDIA/cudnn-frontend#266: Updates overlapping SDPA and diagonal-band-mask validation for cumulative sequence-length inputs.

Suggested reviewers: anerudhan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: mixed-form SDPA sequence lengths with a cuDNN 9.25+ gate.
Description check ✅ Passed The description matches the template well, covering affected area, summary, why, related issues, compatibility, and testing.
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.

@egilliam-nv egilliam-nv added cat-enhancements mod-frontend cuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers. orig-nv-eng Reported or requested by NVIDIA engineering. labels Jul 23, 2026
@egilliam-nv egilliam-nv self-assigned this Jul 23, 2026
@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

@cudnn-ci-bot run

@egilliam-nv
egilliam-nv requested a review from vedaanta July 23, 2026 17:18
@cudnn-ci-bot

Copy link
Copy Markdown

🚀 Running mirror pipeline

Branch: cudnn-gh/pr-430-da67de4
Pipeline: 59279176

@egilliam-nv
egilliam-nv force-pushed the feature/cu_seqlens_mixed branch from da67de4 to 14e9175 Compare July 24, 2026 20:08
@egilliam-nv egilliam-nv changed the title Support mixed-form sequence lengths in SDPA forward (cuDNN 9.26+) Support mixed-form sequence lengths in SDPA forward (cuDNN 9.25+) Jul 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/python/test_mhas_v2.py (1)

192-192: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Format these calls with Black.

These three changed calls exceed the configured 160-character limit.

  • test/python/test_mhas_v2.py#L192-L192: wrap the RandomHiddenDimSize arguments.
  • test/python/test_mhas_v2.py#L481-L481: wrap the RandomHiddenDimSize arguments.
  • test/python/test_mhas_v2.py#L654-L654: wrap the RandomHiddenDimSize arguments.

As per coding guidelines, “Format Python code and notebooks with Black using a line length of 160.”

🤖 Prompt for 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.

In `@test/python/test_mhas_v2.py` at line 192, Format the RandomHiddenDimSize
calls with Black’s configured 160-character line length, wrapping their
arguments at test/python/test_mhas_v2.py lines 192-192, 481-481, and 654-654
without changing behavior.

Source: Coding guidelines

🧹 Nitpick comments (1)
test/python/test_mhas_v2.py (1)

1049-1079: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise the UNIFIED path explicitly.

The feature under test is gated in the UNIFIED surface, but this config requests AUTO; the test can pass without covering that path. Set implementation to UNIFIED, or verify that AUTO is guaranteed to resolve to it here.

Proposed fix
-        implementation=cudnn.attention_implementation.AUTO,
+        implementation=cudnn.attention_implementation.UNIFIED,
🤖 Prompt for 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.

In `@test/python/test_mhas_v2.py` around lines 1049 - 1079, Update the
implementation setting in the SDPATestConfig and its nested ExecConfig within
the test setup to explicitly use cudnn.attention_implementation.UNIFIED instead
of AUTO, ensuring this test exercises the gated UNIFIED path.
🤖 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.

Outside diff comments:
In `@test/python/test_mhas_v2.py`:
- Line 192: Format the RandomHiddenDimSize calls with Black’s configured
160-character line length, wrapping their arguments at
test/python/test_mhas_v2.py lines 192-192, 481-481, and 654-654 without changing
behavior.

---

Nitpick comments:
In `@test/python/test_mhas_v2.py`:
- Around line 1049-1079: Update the implementation setting in the SDPATestConfig
and its nested ExecConfig within the test setup to explicitly use
cudnn.attention_implementation.UNIFIED instead of AUTO, ensuring this test
exercises the gated UNIFIED path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 47ca0cff-b6df-42cc-b8db-1a49a661e6d5

📥 Commits

Reviewing files that changed from the base of the PR and between da67de4 and 14e9175.

📒 Files selected for processing (5)
  • include/cudnn_frontend/node/diagonal_band_mask.h
  • include/cudnn_frontend/node/sdpa_support_surface.h
  • test/python/sdpa/fp16.py
  • test/python/sdpa/random_config.py
  • test/python/test_mhas_v2.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • include/cudnn_frontend/node/diagonal_band_mask.h
  • include/cudnn_frontend/node/sdpa_support_surface.h
  • test/python/sdpa/random_config.py

@egilliam-nv
egilliam-nv force-pushed the feature/cu_seqlens_mixed branch from 14e9175 to 49d108f Compare July 24, 2026 20:20
@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

Thanks @coderabbitai.

  • UNIFIED path: done — the test now sets implementation=cudnn.attention_implementation.UNIFIED explicitly (both the SDPATestConfig and the nested ExecConfig), so it no longer relies on AUTO resolving to it.
  • Black on RandomHiddenDimSize (L192/L481/L654): skipping — those lines are not part of this PR's diff (our changes are confined to the mixed-form test near L1024+ and the per-side plumbing in sdpa/). They're pre-existing long lines introduced by test_mhas_v2: extend bwd random head-dim coverage to d=256 #425's d=256 coverage; black --line-length 160 --check reports our changed files clean. Better addressed in a separate formatting change so this PR stays scoped.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@egilliam-nv Thanks for the clarification. The explicit UNIFIED configuration covers the test-path concern, and keeping the pre-existing, out-of-diff Black formatting in a separate change is appropriately scoped.

🐇 ✅

@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

@cudnn-ci-bot run

@cudnn-ci-bot

Copy link
Copy Markdown

🚀 Running mirror pipeline

Branch: cudnn-gh/pr-430-49d108f
Pipeline: 59469978

@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

Good catch on the stale sample doc — fixed in 62424a9.

fp16_fwd_with_cu_seq_len.cpp no longer claims cu_seq_len_q/kv must both be set or that cu_seq_len_* are mutually exclusive with seq_len_*; it now documents the per-side rules (each side independently uses one form; both sides present but forms may differ; mixed forms require 9.25+, plain cu_seq_len on both sides remains 9.24+).

I also swept the same now-stale wording out of the parallel parameter docs while here: docs/operations/Attention.md (C++ and Python sections) and the sdpa pybind docstrings in python/pygraph/sdpa.cpp.

@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

@cudnn-ci-bot run

@cudnn-ci-bot

Copy link
Copy Markdown

🚀 Running mirror pipeline

Branch: cudnn-gh/pr-430-62424a9
Pipeline: 59812961

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@docs/operations/Attention.md`:
- Line 327: Update the duplicated SDPA sequence-length summaries consistently:
in docs/operations/Attention.md lines 327-327, allow the padding-mask summary to
accept either per-batch or cumulative lengths; in docs/operations/Attention.md
lines 914-914, state that cuDNN 9.24+ supports cumulative forms while cuDNN
9.25+ is required only for mixed forms; and in python/pygraph/sdpa.cpp lines
1307-1308, document opposite-side length pairing, the requirement for
use_padding_mask=True, and the mixed-form version requirement.
🪄 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: 8c6b0cbd-7ff0-49d2-8693-45ed1f764d19

📥 Commits

Reviewing files that changed from the base of the PR and between 49d108f and 62424a9.

📒 Files selected for processing (3)
  • docs/operations/Attention.md
  • python/pygraph/sdpa.cpp
  • samples/cpp/sdpa/fp16_fwd_with_cu_seq_len.cpp

Comment thread docs/operations/Attention.md
@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

Thanks — addressed in c282492.

  • Regular use_padding_mask summary (docs/operations/Attention.md): no longer says "Must also provide seq_len_q and seq_len_kv"; now accepts either per-batch or cumulative lengths on each side.
  • Regular sdpa pybind docstring (python/pygraph/sdpa.cpp): enriched the cu_seq_len_q/kv entries with opposite-side pairing, use_padding_mask=True, and the mixed-form 9.25 requirement, to match the detailed docs.
    • Note on the site labels: sdpa.cpp:1307-1308 is actually the sdpa_fp8 docstring (the regular sdpa one is at 1141) — I updated both.

One deliberate divergence from the suggestion on the FP8 summary: I did not state 9.24+ for cumulative forms there. The FP8 unified engine itself requires cuDNN 9.25+, so cu_seq_len on the FP8 path needs 9.25+ in any form; the 9.24-base / 9.25-mixed split applies only to fp16/bf16. The previous doc commit had incorrectly carried 9.24 into the FP8 docs — that's now corrected to 9.25+.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@python/pygraph/sdpa.cpp`:
- Around line 1141-1142: Wrap the cu_seq_len_q and cu_seq_len_kv documentation
in the relevant API comments, including the corresponding lines around their
later occurrence, so no C++ source line exceeds 120 columns. Preserve the
rendered wording and formatting semantics while splitting each description
across adjacent documentation lines.
🪄 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: c30765a8-230c-420c-9960-9da48549cec7

📥 Commits

Reviewing files that changed from the base of the PR and between 62424a9 and c282492.

📒 Files selected for processing (2)
  • docs/operations/Attention.md
  • python/pygraph/sdpa.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/operations/Attention.md

Comment thread python/pygraph/sdpa.cpp Outdated
Comment on lines +1141 to +1142
cu_seq_len_q (Optional[cudnn_tensor]): Cumulative sequence length of the query, shape (b+1, 1, 1, 1) or 1-D (b+1,) (promoted automatically), int32 or int64. Mutually exclusive with seq_len_q (a side cannot use both forms); must be paired with a KV-side length tensor (seq_len_kv or cu_seq_len_kv) and requires use_padding_mask=True. The two sides may use different forms (e.g. cu_seq_len_q with seq_len_kv), which requires cuDNN 9.25.0 or newer. Supplying cu_seq_len_q requires cuDNN 9.24.0 or newer and the UNIFIED implementation.
cu_seq_len_kv (Optional[cudnn_tensor]): Cumulative sequence length of the key, shape (b+1, 1, 1, 1) or 1-D (b+1,) (promoted automatically), int32 or int64. Mutually exclusive with seq_len_kv (a side cannot use both forms); must be paired with a Q-side length tensor (seq_len_q or cu_seq_len_q) and requires use_padding_mask=True. The two sides may use different forms (e.g. seq_len_q with cu_seq_len_kv), which requires cuDNN 9.25.0 or newer. Supplying cu_seq_len_kv requires cuDNN 9.24.0 or newer and the UNIFIED implementation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Wrap the new documentation lines to the repository width.

The added C++ source lines substantially exceed the required 120-column limit. Wrap the text across adjacent documentation lines while preserving the rendered wording.

As per coding guidelines, C++ files must use Google-based formatting and a 120-column width.

Also applies to: 1307-1308

🤖 Prompt for 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.

In `@python/pygraph/sdpa.cpp` around lines 1141 - 1142, Wrap the cu_seq_len_q and
cu_seq_len_kv documentation in the relevant API comments, including the
corresponding lines around their later occurrence, so no C++ source line exceeds
120 columns. Preserve the rendered wording and formatting semantics while
splitting each description across adjacent documentation lines.

Source: Coding guidelines

egilliam-nv and others added 4 commits July 28, 2026 09:16
Allow the Q and KV sides of SDPA forward to independently choose their
sequence length representation: per-batch (seq_len_*) or cumulative
(cu_seq_len_*). Previously the two forms were mutually exclusive across
the whole operation, forcing paged-attention integrations -- whose
natural state is a cumulative Q prefix sum alongside per-batch KV
lengths -- to materialize a KV-side prefix sum purely to satisfy the
pairing rule.

- sdpa_support_surface: validation is now per-side (exactly one form
  per side, sides provided together); the paged requirement accepts
  either form per side; mixed forms are gated on cuDNN 9.25+ in the
  UNIFIED surface. Hoist a has_input helper for the presence checks.
- diagonal_band_mask: relax the node's metadata seqlen check to
  per-side exclusivity, matching the SDPA rules.
- tests: per-side form control in the SDPA test harness
  (cu_seq_len_sides) and a deterministic mixed-form test with
  non-uniform lengths, including bottom-right causal cases that guard
  the backend's band-mask alignment derivation.

Validated on H100 against a cuDNN 9.27 dev build: mixed forms in both
directions match the both-per-batch reference for non-paged, ragged,
and paged (ragged Q + page tables, cu_seq_len_q + seq_len_kv) graphs;
the deterministic tests skip below the version gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…forms

The prior wording described the pre-relaxation constraints -- "cu_seq_len_q
and cu_seq_len_kv must both be set or both unset" and "cu_seq_len_* are
mutually exclusive with seq_len_q / seq_len_kv" -- which this change makes
stale and misleading. Update them to the per-side rules: each side
independently picks one form (per-batch or cumulative), the two sides must
both be present but may use different forms, and mixed forms require
cuDNN 9.25+ (plain cu_seq_len on both sides remains 9.24+).

Touches the fp16_fwd_with_cu_seq_len sample header, the C++/Python parameter
docs in docs/operations/Attention.md, and the sdpa pybind docstrings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Follow-up to review: several duplicated sequence-length summaries still
described the pre-relaxation contract, and the previous doc commit set
the wrong version floor on the FP8 path.

- Attention.md: the regular-sdpa use_padding_mask summary still said
  "Must also provide seq_len_q and seq_len_kv"; now allows either
  per-batch or cumulative lengths.
- python/pygraph/sdpa.cpp: enrich the regular sdpa cu_seq_len_q/kv
  docstrings (opposite-side pairing, use_padding_mask=True, mixed-form
  9.25 requirement) to match the detailed docs.
- Correct the FP8 cu_seq_len docs (Attention.md and the sdpa_fp8
  docstrings): the FP8 path requires cuDNN 9.25+ for cumulative
  sequence lengths in any form (the FP8 unified engine itself is 9.25+),
  so the 9.24-base / 9.25-mixed split applies only to fp16/bf16.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review follow-up: the enriched cu_seq_len_q/kv docstring lines in the
sdpa and sdpa_fp8 pybind blocks were ~550 chars, well beyond the other
parameter lines. Condense the wording (dropping redundant phrasings)
while keeping the constraints: same-side exclusivity, opposite-side
pairing, use_padding_mask=True, and the version floors (regular 9.24+,
mixed 9.25+; fp8 9.25+).

These live inside a single R"pbdoc(...)pbdoc" raw string where the block
documents one parameter per line, so a source line break would insert a
literal newline into the rendered help text; the lines are shortened
rather than wrapped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@egilliam-nv
egilliam-nv force-pushed the feature/cu_seqlens_mixed branch from c282492 to a1772cb Compare July 28, 2026 16:22
@egilliam-nv

Copy link
Copy Markdown
Collaborator Author

Addressed in a1772cb — but shortened rather than wrapped, for a structural reason.

These cu_seq_len_q/kv lines live inside a single R"pbdoc(...)pbdoc" raw string, and the block documents one parameter per line. A source-level line break inside a raw string becomes a literal newline in the rendered help() text, so wrapping would split a parameter description mid-sentence in the output (and would be inconsistent with every other entry in the block — 80+ of these docstring lines already exceed 120 columns, and clang-format leaves raw-string contents untouched).

Instead I condensed the wording so the lines are no longer outliers (~550 → ~370 chars, in line with existing long entries like dropout/generate_stats), while keeping all the constraints: same-side exclusivity, opposite-side pairing, use_padding_mask=True, and the version floors (regular 9.24+ / mixed 9.25+; fp8 9.25+).

@Anerudhan
Anerudhan merged commit 2a5e3ac into NVIDIA:develop Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat-enhancements mod-frontend cuDNN frontend APIs, operation graph construction, plans, and user-facing wrappers. orig-nv-eng Reported or requested by NVIDIA engineering.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants