[feat][WIP]: support multistream overlap(dbo) for deepseek #941
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.
What this PR does / why we need it?
Based on the design of dual-batch overlap proposed by Deepseek team and also the implementation of fused moe in VLLM project, we implement the multi-stream(also known as dual-batch) overlap for deepseek+mla on Ascend NPU. We split the input batch of model into two microbatches and then overlap the comp/comm ops in attention and moe layers using two streams to improve the performance. Our approach can be easily extended when adding dispatch/combine communications for moe layer.
Compared with the previously proposed draft, we use one stream for computation ops and the other for communication ops, separately. In out opinions, it is beneficial for arranging the order of executing different ops and thus avoiding the contention of computation/communication resources.
Note that this PR is in progress. The benchmark performance will be updated soon.
ref: overlap for llama
ref: dbo in sglang
Does this PR introduce any user-facing change?
Adding a switch in vllm (or env variable in vllm-ascend) to control whether we enable or disable the function of dbo/multistream. By default we will not enable the function of multi-stream/dbo.
How was this patch tested?
Currently, we can test it by adding '--enable-multi-stream' when starting the vllm online service using the specified version of vllm. We will update the related modifications in vllm soon.
Any advice/discussion is welcome.