Repository navigation
Pipeline parallel: accept Qwen4Exp QSA layers under the transformers 5.17 name (qwen_sparse_attention) - #17895
Merged
Merged
Conversation
… 5.1x name too #17785 proved PP for Qwen4Exp hybrid stacks and allow-listed the QSA layer as "indexed_attention", the name transformers 5.23 uses. transformers 5.17 (unsloth's default pin) calls it "qwen_sparse_attention", so _refuse_unsupported raised 'does not support hybrid layer stacks' and every PP cell of test_qwen4exp_parallel_gloo.py and test_frozen_table_pp_gloo.py failed in the gloo shard on main. Allow both names; a test pins each.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Summary
Repo tests (CPU, gloo)has failed onmainsince #17785 (FSDP2, TP and PP for Qwen3.8-Flash-Next and DeepSeek-V4.1). Every pipeline-parallel cell oftests/test_qwen4exp_parallel_gloo.pyandtests/test_frozen_table_pp_gloo.pyexits withrank exit codes [1, 1](15 tests):#17785 allow-lists Qwen4Exp's layer types for PP as
{"linear_attention", "indexed_attention"}. That is what transformers 5.23 calls the QSA layer. transformers 5.17, unsloth's default pin and what the CPU shards install, calls the same layer"qwen_sparse_attention"; the configuration convertsfull_attentionentries into it. So on 5.17 the guard refuses the exact stack the PR proved, and users on that pin cannot use PP for Qwen4Exp either.Change
unsloth/models/pp_native.py:_PP_HYBRID_FAMILIES["Qwen4ExpForCausalLM"]also allows"qwen_sparse_attention". The comment notes the rename.tests/test_qwen4exp_parallel_gloo.py: newtest_pp_accepts_the_qsa_layer_name_of_every_transformers, parametrized over both names. It sets the built model'slayer_typesto each name and checks_refuse_unsupporteddoes not refuse. It runs on whichever transformers is installed.Verification
transformers 5.17.0,
tests/test_frozen_table_pp_gloo.py tests/test_qwen4exp_parallel_gloo.py:pp_native.pychange revertedqwen_sparse_attentioncase of the new test fails,indexed_attentionpasses