Fix SequenceDescriptor.from_segment_ids_and_pos() for TE >= 2.12#86
Closed
yeandy wants to merge 1 commit into
Closed
Fix SequenceDescriptor.from_segment_ids_and_pos() for TE >= 2.12#86yeandy wants to merge 1 commit into
yeandy wants to merge 1 commit into
Conversation
TransformerEngine v2.12 (NVIDIA/TransformerEngine#2523) made `is_thd` and `is_segment_ids_reordered` required keyword arguments on `SequenceDescriptor.from_segment_ids_and_pos()` to fix incorrect segment position calculation for THD layouts. Since the packing branch in `cudnn_flash_attention` uses `qkv_layout="THD_THD_THD"` with standard (non-reordered) segment IDs, the correct values are `is_thd=True, is_segment_ids_reordered=False`. Without this fix, any configuration using `attention="cudnn_flash_te"` with `packing=True` and real data (`dataset_type != "synthetic"`) fails with: TypeError: SequenceDescriptor.from_segment_ids_and_pos() missing 2 required keyword-only arguments: 'is_thd' and 'is_segment_ids_reordered'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TransformerEngine v2.12 (NVIDIA/TransformerEngine#2523) made
is_thdandis_segment_ids_reorderedrequired keyword arguments onSequenceDescriptor.from_segment_ids_and_pos()to fix incorrect segment position calculation for THD layouts.Since the packing branch in
cudnn_flash_attentionusesqkv_layout="THD_THD_THD"with standard (non-reordered) segment IDs, the correct values areis_thd=True, is_segment_ids_reordered=False.Without this fix, any configuration using
attention="cudnn_flash_te"withpacking=Trueand real data (dataset_type != "synthetic") fails with: