Skip to content

[Perf]Optimize waiting queue update with set usage#20503

Merged
Kangyan-Zhou merged 3 commits intosgl-project:mainfrom
Jacki1223:can_run_list_perf_opt
Mar 18, 2026
Merged

[Perf]Optimize waiting queue update with set usage#20503
Kangyan-Zhou merged 3 commits intosgl-project:mainfrom
Jacki1223:can_run_list_perf_opt

Conversation

@Jacki1223
Copy link
Copy Markdown
Contributor

@Jacki1223 Jacki1223 commented Mar 13, 2026

Motivation and Modifications

By moving from recreating the set on every iteration to creating it just once and reusing it subsequently, and assuming waiting_queue has length n and can_run_list has length m, the time complexity decreases from O(n × m) to O(n + m).

Accuracy Tests

gsm8k:
Accuracy: 0.952 Invalid: 0.000 Latency: 68.010s Output throughput: 1209.593 token/s

Benchmarking and Profiling

device: H200*2
Models: Qwen3-Next-80B-A3B-FP8
num-prompt:500 random-input-len: 1K random-output-len:1K
Org: Req throughput: 7.57 req/s Mean TTFT: 3229.88ms Mean ITL: 84.52ms
Opt: Req throughput: 7.64 req/s Mean TTFT: 2844.76ms Mean ITL: 83.98ms
TTFT decreased by 11.9%

Checklist

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@Jacki1223 Jacki1223 changed the title Optimize waiting queue update with set usage [Perf]Optimize waiting queue update with set usage Mar 13, 2026
@Kangyan-Zhou Kangyan-Zhou merged commit a6c7bb5 into sgl-project:main Mar 18, 2026
58 of 66 checks passed
Wangzheee pushed a commit to Wangzheee/sglang that referenced this pull request Mar 21, 2026
0-693 pushed a commit to 0-693/sglang that referenced this pull request Mar 25, 2026
dutsc pushed a commit to dutsc/sglang that referenced this pull request Mar 30, 2026
JustinTong0323 pushed a commit to JustinTong0323/sglang that referenced this pull request Apr 7, 2026
yhyang201 pushed a commit to yhyang201/sglang that referenced this pull request Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants