-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhanced python_backend autocomplete (#6504)
* Added testing for python_backend autocomplete: optional input and model_transaction_policy
- Loading branch information
1 parent
b0d4612
commit 4985ab9
Showing
28 changed files
with
1,014 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...odel_config/autofill_noplatform/python/model_transaction_policy_invalid_args/config.pbtxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
input [ | ||
{ | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
}, | ||
{ | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
} | ||
] | ||
output [ | ||
{ | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
}, | ||
{ | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
} | ||
] |
1 change: 1 addition & 0 deletions
1
qa/L0_model_config/autofill_noplatform/python/model_transaction_policy_invalid_args/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
model transaction property in auto-complete-config function for model 'model_transaction_policy_invalid_args' contains property other than 'decoupled' |
47 changes: 47 additions & 0 deletions
47
qa/L0_model_config/autofill_noplatform/python/model_transaction_policy_invalid_args/model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of NVIDIA CORPORATION nor the names of its | ||
# contributors may be used to endorse or promote products derived | ||
# from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY | ||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
class TritonPythonModel: | ||
@staticmethod | ||
def auto_complete_config(auto_complete_model_config): | ||
input0 = {"name": "INPUT0", "data_type": "TYPE_FP32", "dims": [4]} | ||
input1 = {"name": "INPUT1", "data_type": "TYPE_FP32", "dims": [4]} | ||
output0 = {"name": "OUTPUT0", "data_type": "TYPE_FP32", "dims": [4]} | ||
output1 = {"name": "OUTPUT1", "data_type": "TYPE_FP32", "dims": [4]} | ||
transaction_policy = {"invalid": "argument"} | ||
|
||
auto_complete_model_config.set_max_batch_size(4) | ||
auto_complete_model_config.set_model_transaction_policy(transaction_policy) | ||
auto_complete_model_config.add_input(input0) | ||
auto_complete_model_config.add_input(input1) | ||
auto_complete_model_config.add_output(output0) | ||
auto_complete_model_config.add_output(output1) | ||
|
||
return auto_complete_model_config | ||
|
||
def execute(self, requests): | ||
pass |
28 changes: 28 additions & 0 deletions
28
qa/L0_model_config/autofill_noplatform/python/model_transaction_policy_mismatch/config.pbtxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
model_transaction_policy { | ||
decoupled: false | ||
} | ||
|
||
input [ | ||
{ | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
}, | ||
{ | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
} | ||
] | ||
output [ | ||
{ | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
}, | ||
{ | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
} | ||
] |
1 change: 1 addition & 0 deletions
1
qa/L0_model_config/autofill_noplatform/python/model_transaction_policy_mismatch/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
trying to change decoupled property in auto-complete-config for model 'model_transaction_policy_mismatch', which is already set to 'False' |
46 changes: 46 additions & 0 deletions
46
qa/L0_model_config/autofill_noplatform/python/model_transaction_policy_mismatch/model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of NVIDIA CORPORATION nor the names of its | ||
# contributors may be used to endorse or promote products derived | ||
# from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY | ||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
class TritonPythonModel: | ||
@staticmethod | ||
def auto_complete_config(auto_complete_model_config): | ||
input0 = {"name": "INPUT0", "data_type": "TYPE_FP32", "dims": [4]} | ||
input1 = {"name": "INPUT1", "data_type": "TYPE_FP32", "dims": [4]} | ||
output0 = {"name": "OUTPUT0", "data_type": "TYPE_FP32", "dims": [4]} | ||
output1 = {"name": "OUTPUT1", "data_type": "TYPE_FP32", "dims": [4]} | ||
|
||
auto_complete_model_config.set_max_batch_size(4) | ||
auto_complete_model_config.set_model_transaction_policy(dict(decoupled=True)) | ||
auto_complete_model_config.add_input(input0) | ||
auto_complete_model_config.add_input(input1) | ||
auto_complete_model_config.add_output(output0) | ||
auto_complete_model_config.add_output(output1) | ||
|
||
return auto_complete_model_config | ||
|
||
def execute(self, requests): | ||
pass |
24 changes: 24 additions & 0 deletions
24
qa/L0_model_config/autofill_noplatform_success/python/model_transaction_policy/config.pbtxt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
input [ | ||
{ | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
}, | ||
{ | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
} | ||
] | ||
output [ | ||
{ | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
}, | ||
{ | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: [ 4 ] | ||
} | ||
] |
46 changes: 46 additions & 0 deletions
46
qa/L0_model_config/autofill_noplatform_success/python/model_transaction_policy/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "model_transaction_policy" | ||
version_policy { | ||
latest { | ||
num_versions: 1 | ||
} | ||
} | ||
max_batch_size: 4 | ||
input { | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
input { | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
instance_group { | ||
name: "model_transaction_policy" | ||
count: 1 | ||
gpus: 0 | ||
kind: KIND_GPU | ||
} | ||
default_model_filename: "model.py" | ||
optimization { | ||
input_pinned_memory { | ||
enable: true | ||
} | ||
output_pinned_memory { | ||
enable: true | ||
} | ||
} | ||
backend: "python" | ||
model_transaction_policy { | ||
decoupled: true | ||
} |
46 changes: 46 additions & 0 deletions
46
qa/L0_model_config/autofill_noplatform_success/python/model_transaction_policy/expected.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "model_transaction_policy" | ||
version_policy { | ||
latest { | ||
num_versions: 1 | ||
} | ||
} | ||
max_batch_size: 4 | ||
input { | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
input { | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
instance_group { | ||
name: "model_transaction_policy" | ||
count: 1 | ||
gpus: 0 | ||
kind: KIND_GPU | ||
} | ||
default_model_filename: "model.py" | ||
optimization { | ||
input_pinned_memory { | ||
enable: true | ||
} | ||
output_pinned_memory { | ||
enable: true | ||
} | ||
} | ||
backend: "python" | ||
model_transaction_policy { | ||
decoupled: true | ||
} |
46 changes: 46 additions & 0 deletions
46
qa/L0_model_config/autofill_noplatform_success/python/model_transaction_policy/expected.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "model_transaction_policy" | ||
version_policy { | ||
latest { | ||
num_versions: 1 | ||
} | ||
} | ||
max_batch_size: 4 | ||
input { | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
input { | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
instance_group { | ||
name: "model_transaction_policy" | ||
count: 1 | ||
gpus: 0 | ||
kind: KIND_GPU | ||
} | ||
default_model_filename: "model.py" | ||
optimization { | ||
input_pinned_memory { | ||
enable: true | ||
} | ||
output_pinned_memory { | ||
enable: true | ||
} | ||
} | ||
backend: "python" | ||
model_transaction_policy { | ||
decoupled: true | ||
} |
46 changes: 46 additions & 0 deletions
46
qa/L0_model_config/autofill_noplatform_success/python/model_transaction_policy/expected.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "model_transaction_policy" | ||
version_policy { | ||
latest { | ||
num_versions: 1 | ||
} | ||
} | ||
max_batch_size: 4 | ||
input { | ||
name: "INPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
input { | ||
name: "INPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT1" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
output { | ||
name: "OUTPUT0" | ||
data_type: TYPE_FP32 | ||
dims: 4 | ||
} | ||
instance_group { | ||
name: "model_transaction_policy" | ||
count: 1 | ||
gpus: 0 | ||
kind: KIND_GPU | ||
} | ||
default_model_filename: "model.py" | ||
optimization { | ||
input_pinned_memory { | ||
enable: true | ||
} | ||
output_pinned_memory { | ||
enable: true | ||
} | ||
} | ||
backend: "python" | ||
model_transaction_policy { | ||
decoupled: true | ||
} |
Oops, something went wrong.