Skip to content

[BugFix] Graceful handling of torch symm mem errors.#27671

Merged
mgoin merged 10 commits intovllm-project:mainfrom
neuralmagic:imarkov/enable_symm_mem
Nov 12, 2025
Merged

[BugFix] Graceful handling of torch symm mem errors.#27671
mgoin merged 10 commits intovllm-project:mainfrom
neuralmagic:imarkov/enable_symm_mem

Conversation

@ilmarkov
Copy link
Copy Markdown
Contributor

@ilmarkov ilmarkov commented Oct 28, 2025

Disable torch symm mem in case of torch internal errors.
Enable torch symm mem back by default.

Fixes #26922
The problem described in the issue seems to be a conflict between torch and driver which can't be resolved in vllm.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: ilmarkov <markovilya197@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces graceful error handling for torch_symm_mem initialization by catching RuntimeError and disabling the feature, preventing crashes. It also enables torch_symm_mem by default. My review confirms the logic of the error handling. I have one suggestion to improve the logging within the new except block to ensure exception details are correctly captured, which is crucial for debugging.

Signed-off-by: ilmarkov <markovilya197@gmail.com>
Copy link
Copy Markdown
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can land this, but I think we should know what is the conflict between torch and driver which can't be resolved in vllm. And give user guidance how to solve and enable it in case this happens.
@mgoin CC

Copy link
Copy Markdown
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can land this first, but still need to figure out what is the root cause

@yewentao256 yewentao256 added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 3, 2025
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Copy link
Copy Markdown
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not really satisfied by this. Wrapping a try-catch around the problem is not good.
Have we spoke with the torch or nvidia team about this issue?

mgoin and others added 4 commits November 11, 2025 12:50
Signed-off-by: ilmarkov <markovilya197@gmail.com>
Signed-off-by: ilmarkov <markovilya197@gmail.com>
@mgoin mgoin merged commit 1788aa1 into vllm-project:main Nov 12, 2025
53 checks passed
@yewentao256 yewentao256 deleted the imarkov/enable_symm_mem branch November 12, 2025 14:26
geodavic pushed a commit to geodavic/vllm that referenced this pull request Nov 16, 2025
)

Signed-off-by: ilmarkov <markovilya197@gmail.com>
Co-authored-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: George D. Torres <gdavtor@gmail.com>
@robertgshaw2-redhat
Copy link
Copy Markdown
Collaborator

I find that PR introduces significant performance regression on my h200 box for DSR1

image

@robertgshaw2-redhat
Copy link
Copy Markdown
Collaborator

MODEL := "deepseek-ai/DeepSeek-V3.1"

INPUT_LEN := "1000"
OUTPUT_LEN := "100"

launch_vllm:
    VLLM_ALLREDUCE_USE_SYMM_MEM=0 VLLM_MOE_USE_DEEP_GEMM=0 VLLM_USE_DEEP_GEMM=1 VLLM_TORCH_PROFILER_DIR=$(pwd)/profiles_tp chg run --gpus 8 -- vllm serve \
        {{MODEL}} --tensor-parallel-size 8

benchmark BATCH_SIZE NUM_PROMPTS:
    vllm bench serve \
        --model {{MODEL}} \
        --dataset-name random \
        --random-input-len {{INPUT_LEN}} \
        --random-output-len {{OUTPUT_LEN}} \
        --max-concurrency {{BATCH_SIZE}} \
        --num-prompts {{NUM_PROMPTS}} \
        --seed $(date +%M%H%M%S) \
        --percentile-metrics ttft,tpot,itl \
        --ignore-eos

sweep:
    just benchmark 4 40 && \
    just benchmark 8 80 && \
    just benchmark 16 160 && \
    just benchmark 32 320 && \
    just benchmark 64 640


start_profile:
    curl -X POST http://localhost:8000/start_profile

stop_profile:
    curl -X POST http://localhost:8000/stop_profile
  • before (VLLM_ALLREDUCE_USE_SYMM_MEM=0)
just launch_vllm
just benchmark 16 160

@robertgshaw2-redhat
Copy link
Copy Markdown
Collaborator

oops, weirdly looks like this is happening on other backend too

@robertgshaw2-redhat
Copy link
Copy Markdown
Collaborator

image

@robertgshaw2-redhat
Copy link
Copy Markdown
Collaborator

might just be something wrong on my machine

devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
)

Signed-off-by: ilmarkov <markovilya197@gmail.com>
Co-authored-by: Michael Goin <mgoin64@gmail.com>
nvyutwu pushed a commit to nvyutwu/vllm that referenced this pull request Feb 2, 2026
)

Signed-off-by: ilmarkov <markovilya197@gmail.com>
Co-authored-by: Michael Goin <mgoin64@gmail.com>
nvyutwu added a commit to nvyutwu/vllm that referenced this pull request Feb 2, 2026
nvyutwu pushed a commit to nvyutwu/vllm that referenced this pull request Feb 3, 2026
)

Signed-off-by: ilmarkov <markovilya197@gmail.com>
Co-authored-by: Michael Goin <mgoin64@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: torch symm mem - CUDA driver error: system not yet initialized

5 participants