[Bug] Fix Long Context OOM Issue - #25290
Conversation
Signed-off-by: yewentao256 <zhyanwentao@126.com>
There was a problem hiding this comment.
Code Review
This pull request addresses a critical Out-Of-Memory (OOM) error for long-context inference with Multi-Layer Attention (MLA) by reducing the chunked_prefill_workspace_size. While the fix is correct in principle, I've identified a potential issue where the change could lead to an AssertionError with certain configurations, causing a crash. I've provided a suggestion to make the logic more robust and prevent this failure. Overall, a good fix for the OOM problem.
Signed-off-by: yewentao256 <zhyanwentao@126.com>
|
On a DP=16 prefill B200 deepseek v3.1 config, where i should be able to handle 9 full length context requests per DP, I'm now hitting the assertion https://github.com/vllm-project/vllm/blame/273690a50ac2a5fa79fa7acc5077e49aa1af427e/vllm/v1/attention/backends/mla/common.py#L485: Reducing from 128k to 64k under the I expected after this change to be able to start this config with a long deepseekv3 context, but instead it exits immediately. I also can't start 65536 max tokens (not sure why) |
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: charlifu <charlifu@amd.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Purpose
Context from @smarterclayton
The main reason is we allocated too much mem for MLA chunk padding, this PR fixes the issue.
Note: As the comments said,
We should assign
64 * 1024instead of128 * 1024here as well, so this PR also fixes the consistency between comments and code.**The OOM issue is reasonable if we have even more context length using limited GPU memory, considering add
tpor reduce --gpu-memory-utilization 0.9 to a smaller number when OOM. **Test
Now it is fixed.