Skip to content

Commit d0599da

Browse files
Add end-to-end CI test for decoupled model support (#6131) (#6184)
* Add end-to-end CI test for decoupled model support * Address feedback
1 parent f953f08 commit d0599da

File tree

4 files changed

+160
-1
lines changed

4 files changed

+160
-1
lines changed

Dockerfile.QA

+2-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ RUN rm -f /usr/bin/python && \
337337

338338
RUN pip3 install --upgrade wheel setuptools && \
339339
pip3 install --upgrade numpy pillow attrdict future grpcio requests gsutil \
340-
awscli six grpcio-channelz prettytable virtualenv
340+
awscli six grpcio-channelz prettytable virtualenv \
341+
check-jsonschema
341342

342343
# go needed for example go client test.
343344
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://github.com/triton-inference-server/client/blob/main/src/c%2B%2B/perf_analyzer/examples/schema.json",
4+
"title": "Perf Analyzer output data",
5+
"description": "A json file describing the output from a Perf Analyzer run.",
6+
"type": "object",
7+
"required": [
8+
"experiments",
9+
"version"
10+
],
11+
"properties": {
12+
"experiments": {
13+
"description": "The array of all experiments run by Perf Analyzer.",
14+
"type": "array",
15+
"required": [
16+
"experiment",
17+
"requests",
18+
"window_boundaries"
19+
],
20+
"minItems": 1,
21+
"uniqueItems": true,
22+
"items": {
23+
"type": "object",
24+
"properties": {
25+
"experiment": {
26+
"description": "A single experiment run by Perf Analyzer.",
27+
"type": "object",
28+
"required": [
29+
"mode",
30+
"value"
31+
],
32+
"minItems": 1,
33+
"maxItems": 1,
34+
"properties": {
35+
"mode": {
36+
"description": "Operating mode of Perf Analyzer: For example, 'concurrency' or 'request rate'.",
37+
"type": "string"
38+
},
39+
"value": {
40+
"description": "Concurrency or request rate for the current experiment.",
41+
"type": "integer"
42+
}
43+
}
44+
},
45+
"requests": {
46+
"description": "The array of requests sent by Perf Analyzer for this experiment.",
47+
"type": "array",
48+
"items": {
49+
"$ref": "#/properties/experiments/items/properties/$defs/request"
50+
}
51+
},
52+
"$defs": {
53+
"request": {
54+
"description": "Info for a single request.",
55+
"type": "object",
56+
"required": [
57+
"timestamp",
58+
"response_timestamps"
59+
],
60+
"properties": {
61+
"timestamp": {
62+
"description": "Time stamp of the request.",
63+
"type": "integer"
64+
},
65+
"sequence_id": {
66+
"description": "The sequence_id of the request.",
67+
"type": "integer"
68+
},
69+
"response_timestamps": {
70+
"description": "All associated responses to this request.",
71+
"type": "array",
72+
"items": {
73+
"type": "integer"
74+
}
75+
}
76+
}
77+
}
78+
},
79+
"window_boundaries": {
80+
"description": "An array of time stamps describing window boundaries.",
81+
"type": "array",
82+
"items": {
83+
"type": "integer"
84+
},
85+
"uniqueItems": true
86+
}
87+
}
88+
}
89+
},
90+
"version": {
91+
"description": "The version of Perf Analyzer that generated the report.",
92+
"type": "string"
93+
}
94+
}
95+
}

qa/L0_perf_analyzer/test.sh

+32
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ WRONG_OUTPUT_2_JSONDATAFILE=`pwd`/../common/perf_analyzer_input_data_json/wrong_
6464
SEQ_OUTPUT_JSONDATAFILE=`pwd`/../common/perf_analyzer_input_data_json/seq_output.json
6565
SEQ_WRONG_OUTPUT_JSONDATAFILE=`pwd`/../common/perf_analyzer_input_data_json/seq_wrong_output.json
6666

67+
REPEAT_INT32_JSONDATAFILE=`pwd`/../common/perf_analyzer_input_data_json/repeat_int32_data.json
68+
6769
SERVER=/opt/tritonserver/bin/tritonserver
6870
SERVER_ARGS="--model-repository=${DATADIR}"
6971
SERVER_LOG="./inference_server.log"
@@ -121,6 +123,12 @@ cp -r ../python_models/optional $DATADIR && \
121123
mv $DATADIR/optional/model.py $DATADIR/optional/1 && \
122124
sed -i 's/max_batch_size: 0/max_batch_size: 2/g' $DATADIR/optional/config.pbtxt
123125

126+
# Copy decoupled model
127+
git clone --depth=1 https://github.com/triton-inference-server/python_backend
128+
mkdir -p $DATADIR/repeat_int32/1
129+
cp python_backend/examples/decoupled/repeat_config.pbtxt $DATADIR/repeat_int32/config.pbtxt
130+
cp python_backend/examples/decoupled/repeat_model.py $DATADIR/repeat_int32/1/model.py
131+
124132
# Generating test data
125133
mkdir -p $TESTDATADIR
126134
for INPUT in INPUT0 INPUT1; do
@@ -871,6 +879,30 @@ if [ $(cat $CLIENT_LOG | grep "${ERROR_STRING}" | wc -l) -ne 0 ]; then
871879
fi
872880
set -e
873881

882+
## Test decoupled model support
883+
$PERF_ANALYZER -v -m repeat_int32 --input-data=$REPEAT_INT32_JSONDATAFILE \
884+
--profile-export-file profile_export.json -i grpc --async --streaming -s \
885+
${STABILITY_THRESHOLD} >$CLIENT_LOG 2>&1
886+
if [ $? -ne 0 ]; then
887+
cat $CLIENT_LOG
888+
echo -e "\n***\n*** Test Failed\n***"
889+
RET=1
890+
fi
891+
python3 -c "import json ; \
892+
requests = json.load(open('profile_export.json'))['experiments'][0]['requests'] ; \
893+
assert any(len(r['response_timestamps']) > 1 for r in requests)"
894+
if [ $? -ne 0 ]; then
895+
cat $CLIENT_LOG
896+
echo -e "\n***\n*** Test Failed\n***"
897+
RET=1
898+
fi
899+
check-jsonschema --schemafile perf_analyzer_profile_export_schema.json profile_export.json
900+
if [ $? -ne 0 ]; then
901+
cat $CLIENT_LOG
902+
echo -e "\n***\n*** Test Failed\n***"
903+
RET=1
904+
fi
905+
874906
## Test perf_analyzer with MPI / multiple models
875907

876908
is_synchronized() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"data": [
3+
{
4+
"IN": {
5+
"content": [
6+
4,
7+
2,
8+
0,
9+
1
10+
],
11+
"shape": [
12+
4
13+
]
14+
},
15+
"DELAY": {
16+
"content": [
17+
1,
18+
2,
19+
3,
20+
4
21+
],
22+
"shape": [
23+
4
24+
]
25+
},
26+
"WAIT": [
27+
5
28+
]
29+
}
30+
]
31+
}

0 commit comments

Comments
 (0)