Repository navigation
[CP] Support Qwen3.5 GDN CP - #5184
Merged
Merged
Conversation
acisseJZhong
force-pushed
the
add_gdn_cp_restacked
branch
from
October 8, 2026 23:16
ac93298 to
083fa6c
Compare
acisseJZhong
marked this pull request as ready for review
October 8, 2026 23:18
acisseJZhong
requested review from
fegin,
felipemello1,
pzhan9,
tianyu-l,
wconstab and
wwwjn
as code owners
October 8, 2026 23:18
tianyu-l
approved these changes
Oct 8, 2026
tianyu-l
left a comment
Contributor
There was a problem hiding this comment.
I assume nothing changed from the other one that I stamped -- let me know if you need a new review
Contributor
Author
|
nothing changed, I will wait until CI pass and land |
acisseJZhong
marked this pull request as draft
October 8, 2026 23:29
|
Warning: Unknown label
Please add the new label to .github/pytorch-probot.yml |
|
Warning: Unknown label
Please add the new label to .github/pytorch-probot.yml |
acisseJZhong
force-pushed
the
add_gdn_cp_restacked
branch
3 times, most recently
from
October 9, 2026 02:37
531d973 to
9407ba6
Compare
Contributor
Author
|
failure seems unrelated to this PR. Codex root caused to #5111 |
acisseJZhong
force-pushed
the
add_gdn_cp_restacked
branch
from
October 9, 2026 07:12
9407ba6 to
2838f5a
Compare
acisseJZhong
marked this pull request as ready for review
October 9, 2026 07:13
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
Enable context parallelism for Qwen3.5's hybrid GatedDeltaNet/full-attention
decoder and multimodal input path.
history exchange and recurrent-state composition.
partitioning, or Ulysses CP with contiguous partitioning.
rank can select the correct rows from replicated vision-encoder outputs.
GatedDeltaNet and full-attention layers share one TorchTitan CP mesh and token
partition.
Implementation
The integration follows Attention Gym's
delta-rule context-parallel example.
The local GatedDeltaNet implementation exposes shared convolution and recurrent
stages. The CP adapter replaces only the distributed pieces:
context_parallel_conv_historysupplies each local Q/K/V convolution withthe preceding tokens it needs; and
context_parallel_gdncomposes recurrent state across sequence fragments andruns the local GDN computation.
GatedDeltaNetMetadatacarries packed-sequence offsets and per-batch CP routing.TorchTitan's load balancers expose their token fragments, and
ContextParallelRouting.from_fragments()builds routing that matches the partition used to shard model inputs. Kimi K3
KDA now reuses the same routing path instead of duplicating partition logic.
Limitations
expose the contiguous token fragments required by the stateful kernel.
K/V all-gather CP. Ulysses requires contiguous partitioning.
Tisthe token count and
Cis the CP degree:T % C == 0T % (2 * C) == 0Tests
Tested on NVIDIA H100 GPUs with Attention Gym commit
f6d636e5(mergedattention-gym#576).
Ulysses CP.
Deterministic BF16 runs compared CP=1 with CP=2 at commit
1b100f404, usingthe same seed checkpoint (
seed=42), 2,048 tokens per step, and 10 trainingsteps. CP=2 used Attention Gym CP for GatedDeltaNet and either head-tail K/V
all-gather or contiguous Ulysses for full attention. CUDA graphs were disabled
for all runs. Values come from full-precision TensorBoard metrics; diffs are
absolute percentages relative to CP=1. Collective reduction ordering changes,
so the trajectories are not expected to be bitwise identical.
12.82115112.8211520.0000%12.8211520.0000%6.6718896.6692870.0390%6.6691990.0403%4.1874724.1874100.0015%4.1835890.0927%2.4449622.4451540.0079%2.4451540.0079%4.3930724.3925800.0112%4.3937420.0153%2.7947822.7910700.1328%2.7846530.3624%