[VLM] Reduce GPU memory footprint of CUDA IPC MM feature transport#22662
Open
yhyang201 wants to merge 3 commits intosgl-project:mainfrom
Open
[VLM] Reduce GPU memory footprint of CUDA IPC MM feature transport#22662yhyang201 wants to merge 3 commits intosgl-project:mainfrom
yhyang201 wants to merge 3 commits intosgl-project:mainfrom
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
Author
|
/tag-and-rerun-ci |
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.
Motivation
Under
SGLANG_USE_CUDA_IPC_TRANSPORT=1, each non-source TP rank was creating a full CUDA context on the producer GPU (~500 MiB per rank, ~1.6 GiB at TP=4) because_new_shared_cuda(*handle)routes throughCUDAGuard(handle[0]), andhandle[0]is the producer's device index.handle[0]to the consumer's own device before opening the IPC handle.cudaIpcOpenMemHandleusescudaIpcMemLazyEnablePeerAccess, so the producer's memory is mapped via P2P without touching the producer GPU's context. Applied to both pooled and non-pooled paths;_pool_storage_cacheis keyed by consumer device.MmItemMemoryPoolbytokenizer_worker_num(128 MiB floor) soSGLANG_MM_FEATURE_CACHE_MBis the total budget across workers.SGLANG_MM_FEATURE_CACHE_MBfrom 4 GiB to 1 GiB; add a one-shot WARNING when the pool cannot fit a tensor.Before:

After:

Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci