Skip to content

FA4 TEDotProductAttention#4375

Closed
bbuschkaemper wants to merge 4 commits into
NVIDIA:mainfrom
bbuschkaemper:fa4-training
Closed

FA4 TEDotProductAttention#4375
bbuschkaemper wants to merge 4 commits into
NVIDIA:mainfrom
bbuschkaemper:fa4-training

Conversation

@bbuschkaemper
Copy link
Copy Markdown

What does this PR do ?

Bumps TE version to the merged FA4 support PR, allowing TEDotProductAttention to use FA4. Fixes unit tests that rely on FA3 to also support FA4. Possible related to #4186

⚠️ For major changes (either in lines of code or in its impact), please make sure to first share a design doc with the team. If you're unsure what's the best way to do so, contact the @mcore-oncall.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

Code review

Feel free to message or comment the @mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!

All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.

Step 1: Mark PR as "Ready for Review"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

Step 2: Final Review

For PRs that change megatron/core, once all expert reviewers have approved, the Final Review label is applied automatically and final reviewers are assigned.

For PRs outside megatron/core, this step is skipped.

Step 3: Approved

Once all required reviewers have approved, the Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

For MRs into `dev` branch The proposed review process for `dev` branch is under active discussion.

MRs are mergable after one approval by either eharper@nvidia.com or zijiey@nvidia.com.

…FA3.

Signed-off-by: Björn Buschkämper <bjoern.buschkaemper@gmail.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 18, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@bbuschkaemper bbuschkaemper marked this pull request as ready for review April 24, 2026 11:19
Copilot AI review requested due to automatic review settings April 24, 2026 11:19
@svcnvidia-nemo-ci svcnvidia-nemo-ci requested a review from a team April 24, 2026 11:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Megatron-LM’s pinned TransformerEngine source to a commit that includes FA4 support, and broadens batch-invariance unit tests to run with either FlashAttention-3 or FlashAttention-4 available.

Changes:

  • Bump transformer-engine git revision (and corresponding uv.lock) to a FA4-capable commit.
  • Update BIK unit tests’ skip conditions to accept FA3 or FA4 availability.
  • Regenerate uv.lock with updated dependency metadata.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
pyproject.toml Updates the transformer-engine git rev used by uv.
uv.lock Updates locked TE version and dependency metadata; lockfile markers changed broadly.
tests/unit_tests/transformer/test_te_layers_batch_invariant.py Adds FA4 availability detection and expands skip condition to allow FA3 or FA4.
tests/unit_tests/models/test_gpt_model_batch_invariant.py Adds FA4 availability detection and expands skip condition to allow FA3 or FA4.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Apr 24, 2026
@asolergi-nv
Copy link
Copy Markdown
Contributor

Hey @bbuschkaemper, we will bump TE soon once we are sure & ready to do so. In the meantime, users can still use the CUDNN Fused backend which provides similar performance

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants