fix(engine): use model-native packed attention masks - #1558
Open
wm19999 wants to merge 2 commits into
Open
Conversation
Let each Transformers model construct its backend-specific packed attention mask from reset position IDs. Signed-off-by: amos_wang <86055438+wm19999@users.noreply.github.com>
Cover ordinary, multimodal, eager, and SDPA packed-mask paths. Signed-off-by: amos_wang <86055438+wm19999@users.noreply.github.com>
wm19999
requested review from
garrett4wade,
geshi001,
nuzant,
rchardx and
sitabulaixizawaluduo
as code owners
July 22, 2026 18:20
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
This pull request has been automatically marked as stale because it has not had recent activity within the last 14 days. Please add a comment or push new commits to keep it active. Thank you for your contribution! |
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
Remove the model-family allowlist that injected a hard-coded per-layer attention-mask dictionary into FSDP packed microbatches. Passing
Nonelets each Transformers model build the backend-specific mask it expects from AReaL's reset position IDs, avoiding the Llama/MiniCPM5dict.ndimcrash while keeping Qwen and multimodal preparation model-native.This also adds CPU regressions for:
Related Issue
Fixes #1557
Related to #1132, #1153, and #1442.
Type of Change
Checklist
pre-commit run --all-files)main/review-prcommand/create-prBreaking Change Details (if applicable):
None.
Additional Context
Validation:
PYTHONPATH=. python -m pytest -q tests/test_fsdp_packed_attention_mask.py— 10 passedpre-commit run --all-files— passedgit diff --check— passedDocumentation is not affected because this only changes internal packed-mask plumbing.