[AMD] Broadcast the EAGLE greedy verify decision across TP ranks on ROCm (#34238)
This commit is contained in:
@@ -824,19 +824,17 @@ def eagle_sample(
|
||||
deterministic=True,
|
||||
)
|
||||
|
||||
# Sync sampling results across TP ranks: different GPUs may
|
||||
# produce slightly different target_probs due to floating-point
|
||||
# non-determinism in softmax/top_k/top_p, causing different
|
||||
# sampled tokens. Broadcast from rank 0 to ensure consistency.
|
||||
tp_group = (
|
||||
get_parallel().attn_tp_group
|
||||
if is_dp_attention_enabled()
|
||||
else get_tp_group()
|
||||
)
|
||||
if tp_group.world_size > 1:
|
||||
tp_group.broadcast(predict, src=0)
|
||||
tp_group.broadcast(accept_index, src=0)
|
||||
tp_group.broadcast(num_correct_drafts, src=0)
|
||||
# Sync the verify decision across TP ranks: small per-rank differences in the
|
||||
# tensors feeding this point can make one rank accept a different number of
|
||||
# drafts, which desynchronizes the committed seq_lens and deadlocks the next
|
||||
# TP collective. Broadcast from rank 0 to ensure consistency.
|
||||
tp_group = (
|
||||
get_parallel().attn_tp_group if is_dp_attention_enabled() else get_tp_group()
|
||||
)
|
||||
if tp_group.world_size > 1:
|
||||
tp_group.broadcast(predict, src=0)
|
||||
tp_group.broadcast(accept_index, src=0)
|
||||
tp_group.broadcast(num_correct_drafts, src=0)
|
||||
|
||||
if SIMULATE_ACC_LEN > 0:
|
||||
# Do simulation. The helper builds (and returns) a replacement
|
||||
|
||||
Reference in New Issue
Block a user