Change attention mask type to uint8 for cudnn_flash_te #2303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This forces the dtype of the attention mask for TransfromerEngine to be uint8. This allows DeepSeekV3 and other models to run through TransformerEngine (using the nightly jax:maxtext container from 09-04-2025).
This is needed to pass assert added in TransformerEngine https://github.com/NVIDIA/TransformerEngine/blob/c47f329b2084406093124851a3aeecb935183def/transformer_engine/jax/cpp_extensions/softmax.py#L484 . This enables the MLA from DeepSeekV3 to not through an assert in TransformerEngine.
Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.
Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.
Tests
Please describe how you tested this change, and include any instructions and/or
commands to reproduce.
I ran it locally on H200s and verified the assert is no longer an issue when using cudnn_attn_te as the attention implementation.
Checklist
Before submitting this PR, please make sure (put X in square brackets):