NVIDIA / NVIDIA/TransformerEngine

Support more than 1 shape/attention_params for DotProductAttention decision cache

Open
#1,349 0 comments 0 reactions 1 assignee View on GitHub

@cyanguwa is already working on this.

Since Nov 29, 2024.

enhancement
Dominant language
Python
Stars
3.5k
Forks
831
Avg merge
3d 11h
Merged PRs (30d)
65

Description

Currently, DotProductAttention caches decisions like get_attention_backend for 1 set of attention_params and this helps reduce CPU overhead in the DotProductAttention call. However, when using model architectures with more than 1 shape for Attention (for example, Self and Cross Attention), this caching fails as it resets each time the params change.
This is a feature request to support more than 1 attention_params in the cache. Ideally this number can be configurable as some models tend to have more than 2 shapes as well but maybe 4 can be a safe number to start (if not configurable).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.