Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions slime_plugins/models/qwen3_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ def __init__(

self.input_layernorm = RMSNorm(self.hf_config.hidden_size, eps=self.hf_config.rms_norm_eps)

# linear_attn and input_layernorm are replicated, not sharded, across TP ranks.
# Average their gradients across TP so the replicas stay identical; without this,
# nondeterministic kernels let them drift apart a little more every step.
for module in (self.linear_attn, self.input_layernorm):
for param in module.parameters():
param.average_gradients_across_tp_domain = True

def hf_forward(self, hidden_states, packed_seq_params):
hidden_states = self.input_layernorm(hidden_states)
hidden_states = self.linear_attn(
Expand Down
Loading