Add native SDPA Perceiver implementation - #842
Conversation
80c0be1 to
2169459
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
2169459 to
63483a9
Compare
|
@codex may I have your review? |
|
@fomo-bot may I have your review? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f6623874b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # GPU — adds torchvision; PyTorch SDPA supplies optimized attention | ||
| uv add "samudra[cuda]" | ||
| pip install "samudra[cuda]" |
There was a problem hiding this comment.
Remove obsolete native-build installation steps
For users following the updated GPU installation section, the paragraph immediately below still says the cuda extra builds native kernels, requires a CUDA toolchain, and should be installed with --no-build-isolation. This commit removes the compiled attention dependencies and leaves the extra containing only torchvision, so those requirements and the pip command now contradict the package metadata and can unnecessarily complicate installation.
Useful? React with 👍 / 👎.
|
Findings:
I checked the current head Validation I ran locally:
Debug info
|
|
@fomo-bot will you fix this P3 documentation issue? |
|
The P3 documentation issue is already fixed on the current PR head I did not create a new commit because the branch was already synced with that fix and the worktree is clean. Validation on current head:
PR state is still Debug info
|
|
@fomo-bot will you give this PR a final round of review? if you think it should be approved, then please approve it. |
fomo-bot
left a comment
There was a problem hiding this comment.
Final review of current head 6405b11. I found no remaining blocking issues. The stale release-doc paragraph is fixed, and the decoder-query residual suggestion appears to be a false positive against the replaced perceiver-pytorch PerceiverIO behavior. Local validation passed: git diff --check origin/main...HEAD; focused Perceiver/encoder/decoder/mini/quickstart pytest slice; changed-file pre-commit.
|
Approved PR #842 at current head Final review found no remaining blocking issues. I rechecked the two unresolved automated review threads: the release-doc issue is fixed in Validation:
Debug info
|
6405b11 to
416db16
Compare
Summary
perceiver-pytorch,flash-perceiver, and externalflash-attnwith nativePerceiverandPerceiverIOcomponents backed bytorch.nn.functional.scaled_dot_product_attentionautoandsdpause PyTorch dispatch,naiveforces the math backend, andflashforces PyTorch FlashAttentionBackward compatibility
The native modules retain the constructor shape and parameter hierarchy of
perceiver-pytorch; its state dictionaries were verified to load directly and reproduce math-backend outputs within1e-6. Existing model config values remain accepted without edits.The separate
flash-perceiverpackage used a different internal module layout, so checkpoints produced specifically by that backend may require migration even though their configs remain valid.This PR does not include any research decoder/model variants or experiment/search configuration.
Container impact
No new CUDA binary is required. SDPA and its optimized kernels ship with PyTorch. The PhysicsNeMo image continues to supply the compatible PyTorch/CUDA stack, while its package verification and smoke test no longer require the removed external attention wheels.
Validation
uv run --locked pytest -m "not manual and not cuda" -q— 394 passed, 2 skipped, 10 xfailed, 67 deselecteduvx pre-commit run --all-files— passed