NVIDIA / NVIDIA/TransformerEngine
[JAX] Support vmapped cudnn attention
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 831
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 65
Description
Is your feature request related to a problem? Please describe.
Basically, cudnn attention doesn't work when vmapped because of this assertion here:
https://github.com/NVIDIA/TransformerEngine/blob/main/transformer_engine/jax/cpp_extensions/attention.py#L563
This limits its usability when one wants to implement pipeline parallelism as it requires vmapping staged layers over stage buffer.
Describe the solution you'd like
Properly implemented vmap rules for the cudnn attention.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at transformer_engine/jax/cpp_extensions/attention.py around the assertion at line 563, and inspect how cudnn attention is currently handled under vmap. Implement the vmap rules described in the issue, then verify that cudnn attention works when vmapped for pipeline-parallel staged layers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100