Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ def __init__(
or getattr(model_config, "max_num_tokens", 0)
or 4096
)
# Under attention DP, ``ModelConfig`` pre-multiplies
# ``moe_max_num_tokens`` by ``dp_size``. The DG SymmBuffer further
# scales the pool by ``num_ranks`` (= ep_size, which equals dp_size
# in the supported full-ADP topology asserted above). Without this
# divide the buffer is sized as ``dp_size * ep_size *
# max_num_tokens``, doubling the EP factor and exploding HBM (see
# ``layout::Workspace`` / ``get_num_max_pool_tokens`` in DG).
if self.use_dp and self.ep_size > 1:
self.max_num_tokens = max(1, (self.max_num_tokens + self.ep_size - 1) // self.ep_size)

# Resolve the EP ProcessGroup at module construction — creating a
# group at forward time would be collective on a non-synchronous
Expand Down
Loading