NVIDIA / NVIDIA/TransformerEngine

Restructure attention C API

Open
#2,335 0 comments 0 reactions 2 assignees View on GitHub

@cyanguwa is already working on this.

Since May 5, 2026.

2.16.0 attention refactor
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.

At the moment, we enumerate the parameters in C APIs like this:

https://github.com/NVIDIA/TransformerEngine/blob/5e4e0b2c378d2b1ec2ee65dfa85124e1dd805389/transformer_engine/common/fused_attn/fused_attn.cpp#L835

As we add more features to attention, the list of non-tensor variables are also growing, which is a breaking change every time.

Describe the solution you'd like
To avoid the breaking change, we should seek other approaches such as packing most/all of the non-tensor variables into a struct and only modifying the content of the struct as we add features.

Describe alternatives you've considered

N/A

Additional context

N/A

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.