-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V1] Improve TP>1 Error Handling + Stack Trace #11721
[V1] Improve TP>1 Error Handling + Stack Trace #11721
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
vllm/v1/worker/gpu_worker.py
Outdated
@@ -35,6 +35,8 @@ def __init__( | |||
distributed_init_method: str, | |||
): | |||
|
|||
self.i = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE FOR REVIEWER: this is just a simple POC to show an example. Will remove this before landing.
while True: | ||
method, args, kwargs = self.rpc_broadcast_mq.dequeue() | ||
|
||
try: | ||
output = getattr(self.worker, method)(*args, **kwargs) | ||
except BaseException as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -42,21 +41,6 @@ def __init__( | |||
start_engine_loop: bool = True, | |||
) -> None: | |||
|
|||
# The child processes will send SIGQUIT when unrecoverable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: moved to CoreClient
so that it can be shared across AsyncLLM
and LLMEngine
# The child processes will send SIGQUIT when unrecoverable | ||
# errors happen. | ||
def sigquit_handler(signum, frame): | ||
logger.fatal( | ||
"MulitprocExecutor got SIGQUIT from worker processes, shutting " | ||
"down. See stack trace above for root cause issue.") | ||
# Propagate error up to parent process. | ||
parent_process = psutil.Process().parent() | ||
parent_process.send_signal(signal.SIGQUIT) | ||
self.shutdown() | ||
|
||
signal.signal(signal.SIGQUIT, sigquit_handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW: why use SIGQUIT
for these? Users might get weird error messages if they hit ctrl-\
, so I was thinking it might be better to use SIGUSR1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly because this was inspired by SGL and they use SIGQUIT
. I will switch to SIGUSR1
Co-authored-by: Tyler Michael Smith <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Tyler Michael Smith <[email protected]>
SUMMARY:
LLM
when TP>1 (VLLM currently does not clean up all resources in this case)Resulting Stack Trace For "CUDA ERROR" in Worker (Runtime Error)
Worker
(gpu_worker.py
), theEngineCore
(core.py
) and theAsyncLLM
, providing good visibility. This will help to understand the root cause error in cases like an illegal memory access.Resulting Stack Trace For "OOM" in Worker (Startup Error)