Fix comment for tp_rank calculation in dp_attention (#19306)

This commit is contained in:
Shangming Cai
2026-02-25 15:19:10 +08:00
committed by GitHub
parent 17b0affbdf
commit 8d9ee6669e

View File

@@ -238,7 +238,7 @@ def compute_dp_attention_world_info(
attn_dp_rank = 0
else:
# Rank layout is (dp, cp, tp) where tp is the fastest-changing dim:
# tp_rank = ((cp_rank * dp_size) + dp_rank) * attn_tp_size + attn_tp_rank
# tp_rank = (attn_dp_rank * attn_cp_size + attn_cp_rank) * attn_tp_size + attn_tp_rank
attn_dp_rank = tp_rank // (attn_tp_size * attn_cp_size)
return attn_tp_rank, attn_tp_size, attn_dp_rank