Skip to content

ci: Support user-defined is_ready() in Python backend readiness checks#8661

Merged
pskiran1 merged 13 commits intomainfrom
spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel
Mar 9, 2026
Merged

ci: Support user-defined is_ready() in Python backend readiness checks#8661
pskiran1 merged 13 commits intomainfrom
spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel

Conversation

@pskiran1
Copy link
Member

@pskiran1 pskiran1 commented Feb 16, 2026

What does the PR do?

Adds QA coverage for Python backend feature triton-inference-server/python_backend#430

Changes

  • Adds multiple new Python backend test models that implement is_ready() with different behaviors (true/false, exception, non-boolean, coroutine, timeout, decoupled).
  • Expands test_model_readiness.py with a new TestUserDefinedModelReadinessFunction suite covering readiness + inference and concurrent ready/infer requests.

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/python_backend#430

Where should the reviewer start?

Test plan:

  • CI Pipeline ID: 44155589

Caveats:

Background

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

  • closes GitHub issue: #xxx

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds QA coverage for Python backend models that define a custom is_model_ready() implementation, validating readiness behavior across sync/async implementations, error cases, and concurrency.

Changes:

  • Adds multiple new Python backend test models that implement is_model_ready() with different behaviors (true/false, exception, non-boolean, coroutine, timeout, decoupled).
  • Expands test_model_readiness.py with a new TestUserDefinedModelReadinessFunction suite covering readiness + inference and concurrent ready/infer requests.
  • Extends qa/.../model_readiness/test.sh to stand up these additional models and run the new unittest suite.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_timeout/model.py Adds a model whose is_model_ready() intentionally exceeds the default readiness timeout.
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_returns_true_decoupled/model.py Adds a decoupled streaming model that also defines is_model_ready().
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_returns_true_decoupled/config.pbtxt Configures the decoupled streaming model transaction policy and IO.
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_returns_true/model.py Adds a model with is_model_ready() returning True.
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_returns_false/model.py Adds a model with is_model_ready() returning False.
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_returns_non_boolean/model.py Adds a model returning a non-boolean readiness value (negative case).
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_raises_error/model.py Adds a model whose readiness check raises an exception (negative case).
qa/L0_backend_python/model_readiness/test_models/is_model_ready_fn_coroutine_returns_true/model.py Adds a model with an async coroutine is_model_ready().
qa/L0_backend_python/model_readiness/test_model_readiness.py Adds new unittest coverage for user-defined readiness, including concurrency scenarios.
qa/L0_backend_python/model_readiness/test.sh Updates the QA runner to build/load new models and execute the new test suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pskiran1 pskiran1 added the PR: ci Changes to our CI configuration files and scripts label Feb 17, 2026
whoisj
whoisj previously approved these changes Feb 17, 2026
Copy link
Contributor

@whoisj whoisj left a comment

Choose a reason for hiding this comment

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

Approved w/ the assumption you'll react to the CoPilot suggestions.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (3)

qa/L0_backend_python/model_readiness/test.sh:147

  • The coroutine model (readiness_coroutine_model.py) does not use the READINESS_FN_RETURN_VALUE parameter that's being set here with value "coroutine". This parameter is only relevant for the regular readiness_model.py. While harmless since the parameter is simply ignored, it could be confusing for maintainers. Consider either passing an empty string or a placeholder value like "unused" to make it clear this parameter doesn't apply to the coroutine model, or add a comment explaining that this parameter is unused for the coroutine variant.
setup_readiness_test_model "is_model_ready_fn_coroutine_returns_true" "coroutine" "0.1"

qa/L0_backend_python/model_readiness/test_model_readiness.py:78

  • Consider using isinstance(result, InferenceServerException) instead of type(result) == InferenceServerException. While the current pattern exists elsewhere in the codebase (e.g., lifecycle_test.py), using isinstance() is more Pythonic and properly handles inheritance hierarchies. This would make the code more robust if InferenceServerException is ever subclassed.
        if type(result) == InferenceServerException:

qa/L0_backend_python/model_readiness/test_model_readiness.py:231

  • The 0.1 second sleep in the thread launch loop adds unnecessary 1.6 seconds of delay (16 iterations * 0.1s) to the test execution time. Consider removing this sleep or moving it inside the thread functions if you need to stagger the requests themselves rather than just their thread starts. If the intent is to avoid overwhelming the server, the delay should be minimal (e.g., 0.01s) or removed entirely since the test is already designed to handle concurrent requests.
            time.sleep(0.1)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pskiran1 pskiran1 requested a review from yinggeh February 23, 2026 13:18
whoisj
whoisj previously approved these changes Feb 24, 2026
Copy link
Contributor

@whoisj whoisj left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pskiran1 pskiran1 changed the title ci: Support user-defined is_model_ready() in Python backend readiness checks ci: Support user-defined is_ready() in Python backend readiness checks Mar 3, 2026
pskiran1 added 3 commits March 3, 2026 18:16
…-to-tritonpythonmodel' of https://github.com/triton-inference-server/server into spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel
Copy link
Contributor

@whoisj whoisj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for getting through all of this.

 into spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel
@pskiran1 pskiran1 merged commit bbc0b54 into main Mar 9, 2026
3 checks passed
@pskiran1 pskiran1 deleted the spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel branch March 9, 2026 05:06
@pskiran1 pskiran1 restored the spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel branch March 9, 2026 05:13
@pskiran1 pskiran1 deleted the spolisetty/tri-466-amazon-agi-add-health-check-function-to-tritonpythonmodel branch March 9, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: ci Changes to our CI configuration files and scripts

Development

Successfully merging this pull request may close these issues.

4 participants