Skip to content

Document triangle attention kv_lengths fast path#287

Open
jomitchellnv wants to merge 2 commits into
mainfrom
jm/arbitrary-masks
Open

Document triangle attention kv_lengths fast path#287
jomitchellnv wants to merge 2 commits into
mainfrom
jm/arbitrary-masks

Conversation

@jomitchellnv

Copy link
Copy Markdown
Collaborator

Description

Closes #

Checklist

Please confirm the following before requesting review. PRs that do not meet these requirements cannot be merged. See CONTRIBUTING.md for the full contribution rules.

Contribution rules

  • I have read and am adhering to the Contribution Rules.
  • An issue was filed and approved by the NVIDIA team before this PR.
  • I have installed and run pre-commit locally (pip install pre-commit && pre-commit install).
  • This PR addresses a single concern and avoids unnecessary complexity or commented-out code.
  • If this PR is a work in progress, the title is prefixed with [WIP].

Sign-off (DCO)

Per Signing Your Work, every commit in this PR must be signed off with git commit -s (appending Signed-off-by: Your Name <your@email.com>). PRs containing unsigned commits will not be accepted.

  • All commits in this PR are signed off (git commit -s).
  • By signing off, I certify that I have the right to submit this contribution under the project's open source license, in accordance with the Developer Certificate of Origin v1.1.

@copy-pr-bot

copy-pr-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

codex and others added 2 commits June 5, 2026 14:19
Raise ValueError in the public wrapper when both `mask` and `kv_lengths` are
supplied. They are mutually exclusive: `kv_lengths` selects the SM100f length
fast path, while a dense `mask` uses the fallback path. The guard sits before
the backend dispatch, so it surfaces the error early and needs no GPU. Add a
GPU-free regression test.

Signed-off-by: Jonathan Mitchell <jomitchell@nvidia.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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