nccl_ep: Low-Latency kernel memory footpring optimization#2040
Open
artpol84 wants to merge 1 commit intoNVIDIA:masterfrom
Open
nccl_ep: Low-Latency kernel memory footpring optimization#2040artpol84 wants to merge 1 commit intoNVIDIA:masterfrom
artpol84 wants to merge 1 commit intoNVIDIA:masterfrom
Conversation
Reduce LL kernels memory consumption by including the top-k indices into the token message payloads. On dispatch, this allows to avoid maintaining a separate buffer space per local-expert/remote-rank pair and instead have one space for each remote rank. This reduces the memory overhead from O(E x B x H) down to O(N x B x H) where E - number of experts, N - number of ranks, B - batch size, and H - token hidden dimension On combine, the top-k indices are used to reduce the communication buffer from O(E x B x H) to O(K x B x H). Signed-off-by: Artem Y. Polyakov <artemp@nvidia.com>
Collaborator
|
@jskrobola can you help start the mirror? |
Collaborator
Author
|
Update: This change was tested with:
showing no performance degradation compared to pre-optimization code |
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.
Description
Reduce LL kernels memory consumption by including the top-k indices into the token message payloads.
On dispatch, this allows to avoid maintaining a separate buffer space per local-expert/remote-rank pair and instead have one space for each remote rank.
This reduces the memory overhead from O(E x B x H) down to O(N x B x H) where E - number of experts, N - number of ranks, B - batch size, and H - token hidden dimension
On combine, the top-k indices are used to reduce the communication buffer from O(E x B x H) to O(K x B x H).
Related Issues
N/A
Changes & Impact
Changes: Reorganize NCCL EP communication buffer layout.
Impact: Order of magnitude reduction in memory consumption.
Performance Impact
No impact observed