[Refact]Refact MLA/SFA weight prefetch to consist with moe weight prefetch (#6629)
### What this PR does / why we need it?
1. [Refact] Refact MLA/SFA weight prefetch to consist with moe weight
prefetch
2. Remove duplicated o_proj weight prefetch in forward for MLA/SFA
### Does this PR introduce _any_ user-facing change?
NA
### How was this patch tested?
1) Performance result:
Perf test data:
*) MLA:
| | 1st test | 2nd test | Output Token Throughput(Avg) | Performance
improvement percentage |
| --- | --- | --- | --- | --- |
| o_proj duplicate prefetch | 11.9669 token/s | 12.0287 token/s |
11.9978 |
| o_proj no duplicate prefetch | 12.5594 token/s | 12.6216 token/s |
12.5905 | 4.94%| |
single layer performace improve: 5%~8%
*) SFA:
| | 1st test | 2nd test | Output Token Throughput(Avg) | Performance
improvement percentage |
| --- | --- | --- | --- | --- |
| o_proj duplicate prefetch | 13.0523 token/s | 13.1084 token/s |
13.08035 | |
| o_proj no duplicate prefetch | 13.9844 token/s | 14.1678 token/s |
14.0761 | 7.6% |
- vLLM version: v0.15.0
- vLLM main:
d7e17aaacd
---------
Signed-off-by: leo-pony <nengjunma@outlook.com>
This commit is contained in:
@@ -83,7 +83,9 @@ class TestAscendUnquantizedLinearMethod(TestBase):
|
||||
|
||||
class TestAscendRowParallelLinear(BaseLinearTest):
|
||||
|
||||
def test_mlp_optimize(self):
|
||||
@patch("vllm_ascend.ops.linear_op.get_weight_prefetch_method",
|
||||
return_value=MagicMock())
|
||||
def test_mlp_optimize(self, mock_get_weight_prefetch_method):
|
||||
|
||||
ascend_config._ASCEND_CONFIG = MagicMock()
|
||||
ascend_config._ASCEND_CONFIG.recompute_scheduler_enable = False
|
||||
@@ -100,7 +102,9 @@ class TestAscendRowParallelLinear(BaseLinearTest):
|
||||
input_tensor = torch.randn(16, 8)
|
||||
linear(input_tensor)
|
||||
|
||||
def test_oproj_tp(self):
|
||||
@patch("vllm_ascend.ops.linear_op.get_weight_prefetch_method",
|
||||
return_value=MagicMock())
|
||||
def test_oproj_tp(self, mock_get_weight_prefetch_method):
|
||||
|
||||
config._current_vllm_config = MagicMock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user