NVIDIA / NVIDIA/TransformerEngine
thd qkv-format in transformer layer
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 831
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 65
Description
Hello!
I'm currently trying to rewrite my pipeline with TE. I use merged sequences for LM and as far as I know I should use "thd" format for it.
I see that MultiheadAttention class (from here) doesn't support this format (as there is no mention of tithed in args annotation). But DotProductAttention seems to be support "thb".
When I pass qkv_format = "thd" in transformer layer it looks like the only reason why it doesn't work is that in MultiheadAttention we need to pass cu_seqlens to DotProductAttention. Am I correct about it? Thanks.
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 in transformer_engine/pytorch/attention.py, comparing MultiheadAttention and DotProductAttention handling of qkv_format and cu_seqlens. Determine the required behavior for thd inputs in the transformer layer; done means merged-sequence inputs are accepted and the intended support is covered by the relevant existing tests, if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100