Skip to content

Used condition variable for event polling#1857

Open
datenglin wants to merge 5 commits intomainfrom
tpu
Open

Used condition variable for event polling#1857
datenglin wants to merge 5 commits intomainfrom
tpu

Conversation

@datenglin
Copy link
Collaborator

Description

Before this change, the code uses sleep for event polling which has the drawback of potential delay of up to 0.05 seconds. This change uses threading.Condition so we can wait for the signal of scheduler having the requests.

Tests

It passed the Buildkite: https://buildkite.com/tpu-commons/tpu-inference-ci/builds/11630/steps/canvas

Signed-off-by: Dateng Lin <datenglin@google.com>
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a Github issue, please include a link, e.g.,:
FIXES: #123456

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure:

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have made or will make corresponding changes to any relevant documentation.

@datenglin datenglin added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 4, 2026
Signed-off-by: Dateng Lin <datenglin@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant