Skip to content
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

perf: Release GIL during cancellation check #372

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

kthui
Copy link
Contributor

@kthui kthui commented Jul 30, 2024

What does the PR do?

Release the GIL while checking for cancellation. Another Python thread can be performing useful work while the cancellation status is being checked.

Checklist

  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

Check the conventional commit type
box here and add the label to the github PR.

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

Related PRs:

triton-inference-server/vllm_backend#54

Where should the reviewer start?

Can start by verifying the cancellation function, where the GIL is released during its execution, does not access any Python objects.

Test plan:

This is a performance improvement, so any issue should be covered by existing test cases.

  • CI Pipeline ID: 17061062

Caveats:

N/A

Background

Need to improve the performance on vLLM backend.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

N/A

@kthui kthui marked this pull request as draft July 30, 2024 22:07
@kthui kthui marked this pull request as ready for review July 31, 2024 16:55
@kthui kthui requested review from Tabrizian and oandreeva-nv July 31, 2024 16:55
@kthui kthui added the PR: perf A code change that improves performance label Jul 31, 2024
@kthui kthui requested a review from tanmayv25 July 31, 2024 17:10
@kthui kthui requested a review from oandreeva-nv July 31, 2024 22:06
Copy link
Contributor

@oandreeva-nv oandreeva-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kthui kthui merged commit 1393d6e into main Aug 7, 2024
3 checks passed
@kthui kthui deleted the jacky-cancel-gil branch August 7, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: perf A code change that improves performance
Development

Successfully merging this pull request may close these issues.

3 participants