Repository navigation
Multi-GPU vllm serve captures: per-worker reports, pipeline steps, collectives - #3
Merged
Merged
Conversation
…llectives A capture of a tensor- and pipeline-parallel vllm serve holds one set of files per GPU worker. Loading them as one mixed the address spaces of the processes and counted their kernels as overlapping on one GPU. - ledger report writes one report per process under pid-<pid>/; the other commands refuse a capture of several processes and take those directories. - split_steps folds the step markers of pipeline ticks that run no forward pass into the step before them, so a step is one forward pass on that worker. - NCCL collectives get a Collectives section and a 'waiting in collectives' row instead of being reported as underfilled launches; the effective bandwidth excludes that wait. - busy_and_gaps took the span to end with the last launch to start; a kernel that outlasts it made the idle time negative. - vllm_regions: ReplicatedLinear has no per-partition widths; the export raised on it. - The plugin warns when a worker was forked from the process where CUPTI started and will record nothing. - ledger build finds CUPTI in pip-installed nvidia wheels and links libcupti.so.<N> and libcuda.so.1 by file name, which the official vLLM images need.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Running Ledger on a multi-GPU
vllm serve(tensor parallel 2 × pipeline parallel 3, vLLM 0.32, six RTX 5090, official vLLM image) hit several things in a row. None of them shows on a single GPU.ledger buildfailed in the image: CUPTI only exists as a pip wheel (site-packages/nvidia/cu13/{include,lib},libcupti.so.13with nolibcupti.so), and a container getslibcuda.so.1withoutlibcuda.so.ReplicatedLinearhas noinput_size_per_partition, so the server never came up.ledger reportmerged them: pointers of one process were resolved against another's memory map, and kernels of six GPUs counted as overlapping on one.What changes
ledger reporton a capture of several processes writespid-<pid>/report.mdfor each (links to that process's files plus the sharedrun.json).analyze.loadrefuses a multi-process directory and points there, soanalyze,steps,perfetto,transfersanddiffcannot silently mix processes.split_stepsfolds it into the step before it, so a step is one forward pass. Without a memory map nothing is folded.## Collectivessection (launches, median, ms/step, alone ms/step) and awaiting in collectives (part of busy)row in## Step: the time in which only collectives ran. They are no longer listed as underfilled launches, and the effective bandwidth is taken over busy time without that wait.busy_and_gapstook the span to end with the last launch to start. A kernel that outlasts it (a blocking collective, a second stream) made busy exceed the span.vllm_regions: widths fall back toinput_size/output_sizefor layers that are not split across ranks.LEDGER_INIT_PID); the plugin compares it with its own and says on stderr that the worker will record nothing and to setVLLM_WORKER_MULTIPROC_METHOD=spawn.ledger buildalso looks for CUPTI in the nvidia wheels and passes what it found to make; the Makefile linkslibcupti.so.<N>andlibcuda.so.1(or the toolkit's stub) by file name.Checked
pytest tests: 50 passed (42 before; new tests intests/test_multi_gpu.pyandtests/test_build.py).ledger buildfrom this branch inside the stock image, then a small capture with it: timed kernel records come back.multiprocessingscript underLD_PRELOAD: the forked child leaves no kernel records, the spawned one does.LEDGER_GRAPH_WINDOW=1500:300), one worker of the middle pipeline stage, before and after:analyze), 595 (steps)steps)ncclDevKernel_Broadcast_RING_LLruns on 1 block for 170 SMsThe three stages now agree with each other: 300 or 301 steps and a 10.6 ms cycle on each.
Not done
LEDGER_INIT_IN_CHILD=1did not make a forked Python child record anything in my test either; I did not look into why and left it alone.