Repository navigation
Conversation
Signed-off-by: ys2025-AI <yuanshuaien@163.com>
Signed-off-by: ys2025-AI <yuanshuaien@163.com>
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.
PR type
PR information
Summary
Fix a bug in
SequenceParallel._split_model_inputs: it wrote absent input tensors back as present keys (inputs_embeds=None). PEFT's causal-LM forward binds that key and then dropsinput_idswhen delegating to the base model, soQwen3_5Modelreceives neither input and raises:The root cause is the SP input-key handling, not removing / not loading multimodal weights. The
language_model_onlysetup is only one way to reach the text-only SP path and expose the bug; the failure happens in the input plumbing before any vision weights are involved.Changes
inputs_embedswhen the split result isNone;inputs_embedsonly when it has a value;input_idsonly when it has a value._defer_inputs=Trueis unchanged: wheninputs_embedsexists it is still written back.Reproduction
dp_size=2,fsdp_size=2,ulysses_size=2language_model_only=true, text-only dataset (used only as a reproducer for the text-SP path)input_ids/inputs_embedserrorvision tower stripped by language_model_only, running the text-only SP pathand training runs normallyValidation
language_model_only20-step run: first-step loss identical to the non-SP baseline; 20-step max difference3.59e-3(same order as NPU run-to-run nondeterminism).171.8 MB/rankwith the tower stripped.tests/transformers/test_sequence_parallel_and_cp.py -k "language_model_only or sp_runs_text": 1 passed.tests/model/test_language_model_only.py: 6 passed.pre-commit run --files src/twinkle/model/transformers/strategy/sequence_parallel/__init__.py: all hooks pass.ruff check/ruff format --check: pass.