Add diagnosis module for efficient and precise location of slow rank #311
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.
Diagnostic proposal
Distributed large-scale EP is gradually becoming the main deployment strategy for MOE models. However, as the scale of EP increases, the risk of slowdowns in the Dispatch and Combine communication operators also rises. There are many factors, ranging from GPU hardware anomalies and imbalanced MOE computation to issues with communication links, all of which make the detection and localization of the DeepEP slow problems extremely challenging.
To address this, we have designed a diagnosis module. Each rank collects the average waiting time for receiving each token from other ranks and reports these statistics to rank 0. Based on the mean-normalized characteristics of the resulting analysis matrix, rank 0 can effectively detect and precisely localize slow anomalies in distributed communication. In addition, the impact of the overhead of this diagnostic module on performance can be ignored. Supports identifying:
Maintains a statistical matrix of average receive wait times: Matrix[src_rank, dst_rank], where each row represents a source rank and each column represents a destination rank. Example anomaly localization:
Test
The following test case simulates slow behavior: rank 2 sleeps for 1 ms before Dispatch, and rank 3 sleeps for 1 ms before Combine. With the diagnosis feature enabled, the abnormal ranks can be efficiently and accurately identified through the diagnostic logs.
MASTER_ADDR=x1 WORLD_SIZE=2 RANK=0 python ./test_low_latency.py --enable-diagnose
MASTER_ADDR=x1 WORLD_SIZE=2 RANK=1 python ./test_low_latency.py --enable-diagnose