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

refactor: Remove explicit callings to garbage collect #55

Merged
merged 3 commits into from
Aug 6, 2024
Merged

Conversation

kthui
Copy link
Contributor

@kthui kthui commented Aug 2, 2024

What does the PR do?

Remove the explicit calling to garbage collector. The lifecycle of response_sender and response_factory are expected to be handled by the Python backend internally.

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/server#7504
triton-inference-server/python_backend#373

Where should the reviewer start?

N/A

Test plan:

The PR refactors how the response_sender object lifecycle is handled, it is neither a feature nor a bug fix, so existing tests should be sufficient to cover any regression.

  • CI Pipeline ID: 17156719

Caveats:

When parallel tensors > 1, the stub process can fail to unload (with finalize() called and returned successfully), so it is necessary to manually call garbage collect once at the end of finalize().

Background

N/A

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

N/A

@kthui kthui added the PR: refactor A code change that neither fixes a bug nor adds a feature label Aug 2, 2024
@kthui kthui marked this pull request as ready for review August 2, 2024 22:51
src/model.py Outdated Show resolved Hide resolved
src/model.py Outdated Show resolved Hide resolved
src/model.py Outdated Show resolved Hide resolved
Copy link
Contributor

@nnshah1 nnshah1 left a comment

Choose a reason for hiding this comment

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

left some suggestions for logging

Co-authored-by: Neelay Shah <neelays@nvidia.com>
Copy link
Collaborator

@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
Copy link
Contributor Author

kthui commented Aug 6, 2024

Merging the refactor changes first, so the cancellation on response thread can be rebased on top. The test enhancement can be merged separately.

@kthui kthui merged commit a345a1d into main Aug 6, 2024
3 checks passed
@kthui kthui deleted the jacky-rm-gc branch August 6, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants