-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[Core] Use os.sched_yield in ShmRingBuffer instead of time.sleep #9994
[Core] Use os.sched_yield in ShmRingBuffer instead of time.sleep #9994
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
Signed-off-by: Tyler Michael Smith <[email protected]>
6863795
to
02f6c96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great finding!
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]>
Signed-off-by: Tyler Michael Smith <[email protected]>
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]> Signed-off-by: Loc Huynh <[email protected]>
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]> Signed-off-by: Sumit Dubey <[email protected]>
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]>
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]> Signed-off-by: Maxime Fournioux <[email protected]>
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]>
…m-project#9994) Signed-off-by: Tyler Michael Smith <[email protected]>
While profiling #9856, I found that the calls to time.sleep in
shm_broadcast.py
were never taking under 50 microseconds, even ifRINGBUFFER_SLEEP_INTERVAL
is set to 0.This PR switches to use
os.sched_yield()
instead.Using this gist for benchmarking code,
os.sched_yield()
gives us close to what we wanted, at least on my system.