-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
[Doc] add debugging tips #5409
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
Merged
Merged
[Doc] add debugging tips #5409
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| .. _debugging: | ||
|
|
||
| Debugging Tips | ||
| =============== | ||
|
|
||
| Debugging hang/crash issues | ||
| ----------------------------- | ||
|
|
||
| When an vLLM instance hangs or crashes, it is very difficult to debug the issue. Here are some tips to help debug the issue: | ||
|
|
||
| - Set the environment variable `export VLLM_LOGGING_LEVEL=DEBUG` to turn on more logging. | ||
| - Set the environment variable `export NCCL_DEBUG=TRACE` to turn on more logging for NCCL. | ||
| - Set the environment variable `export VLLM_TRACE_FUNCTION=1` . All the function calls in vLLM will be recorded. Inspect these log files, and tell which function crashes or hangs. **Note: it will generate a lot of logs and slow down the system. Only use it for debugging purposes.** | ||
|
youkaichao marked this conversation as resolved.
Outdated
|
||
|
|
||
| With more logging, hopefully you can find the root cause of the issue. | ||
|
|
||
| Here are some common issues that can cause hangs: | ||
|
|
||
| - The network setup is incorrect. The vLLM instance cannot get the correct IP address. You can find the log such as ``DEBUG 06-10 21:32:17 parallel_state.py:88] world_size=8 rank=0 local_rank=0 distributed_init_method=tcp://xxx.xxx.xxx.xxx:54641 backend=nccl``. The IP address should be the correct one. If not, override the IP address by setting the environment variable ``export VLLM_HOST_IP=your_ip_address``. | ||
| - Hardware/driver setup is incorrect. GPU communication cannot be established. You can run a sanity check script below to see if the GPU communication is working correctly. | ||
|
|
||
| .. code-block:: python | ||
| # save it as `test.py`` , and run it with `NCCL_DEBUG=TRACE torchrun --nproc-per-node=8 test.py` | ||
| # adjust `--nproc-per-node` to the number of GPUs you want to use. | ||
| import torch | ||
| import torch.distributed as dist | ||
| dist.init_process_group(backend="nccl") | ||
| data = torch.FloatTensor([1,] * 128).to(f"cuda:{dist.get_rank()}") | ||
| dist.all_reduce(data, op=dist.ReduceOp.SUM) | ||
| torch.cuda.synchronize() | ||
| value = data.mean().item() | ||
| assert value == dist.get_world_size() | ||
|
|
||
| If the problem persists, feel free to open an `issue <https://github.com/vllm-project/vllm/issues/new/choose>`_ on GitHub, with a detailed description of the issue, your environment, and the logs. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.