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

Reduce instance count to 1 for python bls model loading test #6130

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qa/python_models/bls_model_loading/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ output [

instance_group [
{
count: 3
count: 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does an instance count > 1 make it unsafe to use? It's not related to parallel instance loading, right?

Copy link
Contributor Author

@krishung5 krishung5 Aug 1, 2023

Choose a reason for hiding this comment

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

When doing parallel instance loading, all the unit tests are executed during the initialize phase, and loading three model instances simultaneously might cause interference between them. For instance, unloading a model in one instance could impact another unit test that relies on that model in other model instances. This is what I meant by unsafely using the model loading API. In the general usage where the unload call is not recommended, using multiple instances should be fine.

The initial issue that we saw without parallel instance loading could be the unload call during tear down. When the unload call returns, it is not guaranteed that the model is fully unloaded, which may cause some issue to the unit test.

kind: KIND_CPU
}
]
2 changes: 2 additions & 0 deletions qa/python_models/bls_model_loading/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def setUp(self):
self.model_name = "onnx_int32_int32_int32"

def tearDown(self):
# The unload call does not wait for the requested model to be fully
# unloaded before returning.
pb_utils.unload_model(self.model_name)

def test_load_unload_model(self):
Expand Down
Loading