[JAX] Add warning if using BSHD and max_segments_per_seq > 1#2796
Open
jberchtold-nvidia wants to merge 4 commits intoNVIDIA:mainfrom
Open
[JAX] Add warning if using BSHD and max_segments_per_seq > 1#2796jberchtold-nvidia wants to merge 4 commits intoNVIDIA:mainfrom
jberchtold-nvidia wants to merge 4 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
for more information, see https://pre-commit.ci
Collaborator
Author
|
/te-ci jax |
Contributor
Greptile SummaryThis PR adds a
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["fused_attn(qkv, ..., max_segments_per_seq, qkv_layout)"] --> B{"sequence_descriptor is None\nor isinstance ndarray?"}
B -- Yes --> C["warnings.warn(DeprecationWarning)\n→ _legacy_fused_attn(...)"]
B -- No --> D{"max_segments_per_seq > 1\nAND NOT qkv_layout.is_thd()?"}
D -- Yes --> E["warnings.warn(UserWarning, stacklevel=2)\n'max_segments_per_seq has no effect\nwith non-THD layouts'"]
D -- No --> F["_fused_attn(...)"]
E --> F
C --> G["return output (legacy)"]
F --> H["return output"]
Reviews (3): Last reviewed commit: "Update transformer_engine/jax/attention...." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: jberchtold-nvidia <158520091+jberchtold-nvidia@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: jberchtold-nvidia <158520091+jberchtold-nvidia@users.noreply.github.com>
Collaborator
Author
|
/te-ci jax |
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.
Description
Adds a small warning if the user tries to use BSHD with
max_segments_per_seq > 1Type of change
Changes
max_segments_per_seq > 1Checklist: