Skip to content

[PD Perf] replace Queue to FastQueue - #6649

Merged
zhyncs merged 9 commits into
sgl-project:mainfrom
whybeyoung:deque-conn
May 28, 2025
Merged

zhyncs merged 9 commits into
sgl-project:mainfrom
whybeyoung:deque-conn

Conversation

@whybeyoung

@whybeyoung whybeyoung commented May 27, 2025 •

Copy link
Copy Markdown
Collaborator

The original while True queue polling implementation caused some CPU overhead under high concurrency. To minimize CPU usage, a more efficient approach using a deque combined with a Condition mechanism was adopted.

-            while True:
-                try:
-                    kv_chunk: TransferKVChunk = self.transfer_queue.get(timeout=0.01)
-                    reqs_to_be_processed = (
-                        self.transfer_infos[kv_chunk.room].values()
-                        if kv_chunk.room in self.transfer_infos

See the commit ..

CC @ByronHsu @ShangmingCai @zhyncs @fzyzcjy

@zhyncs

zhyncs commented May 27, 2025

Copy link
Copy Markdown
Contributor

@whybeyoung May you help fix the conflicts? QQ can you also share some performance results?

@zhyncs
zhyncs merged commit 6b23132 into sgl-project:main May 28, 2025
ChangyiYang pushed a commit to ChangyiYang/sglang-moe-fix that referenced this pull request May 29, 2025
Signed-off-by: Shangming Cai <[email protected]>
Co-authored-by: Shangming Cai <[email protected]>
Layssy pushed a commit to Layssy/sglang-iaas that referenced this pull request Jun 9, 2025
Signed-off-by: Shangming Cai <[email protected]>
Co-authored-by: Shangming Cai <[email protected]>
xwu-intel pushed a commit to xwu-intel/sglang that referenced this pull request Jun 17, 2025
Signed-off-by: Shangming Cai <[email protected]>
Co-authored-by: Shangming Cai <[email protected]>
0826joyce pushed a commit to 0826joyce/sglang-perf-opt that referenced this pull request May 19, 2026
Signed-off-by: Shangming Cai <[email protected]>
Co-authored-by: Shangming Cai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants