@@ -127,6 +127,25 @@ def test_grpc_stream(self, sequence_id=0, sequence_start=False):
127
127
self .assertEqual (res_count , data_item .as_numpy ("OUTPUT" )[0 ][0 ])
128
128
self .assertEqual (0 , res_count )
129
129
130
+ def test_reschedule_error (self ):
131
+ # Use short idle timeout (< backend reschedule delay: 0.5s) so that
132
+ # the backend won't be able to reschedule the request as the scheduler
133
+ # will terminate the sequence early
134
+ config = r'"sequence_batching" : { "generative_sequence" : true, "max_sequence_idle_microseconds" : 200000 }'
135
+ with grpcclient .InferenceServerClient ("localhost:8001" ) as triton_client :
136
+ triton_client .load_model (
137
+ "generative_sequence" , config = MODEL_CONFIG_BASE .format (config )
138
+ )
139
+ with self .assertRaises (InferenceServerException ) as context :
140
+ # Without specifying 'generative_sequence : true', the sequence
141
+ # batcher expects sequence parameters to be provided explicitly
142
+ self .test_grpc_stream ()
143
+ print (str (context .exception ))
144
+ self .assertTrue (
145
+ "must specify the START flag on the first request of the sequence"
146
+ in str (context .exception )
147
+ )
148
+
130
149
def test_unsupported_sequence_scheduler (self ):
131
150
# Override model config with scheduler settings that do not support
132
151
# request rescheduling.
@@ -145,7 +164,6 @@ def test_unsupported_sequence_scheduler(self):
145
164
# batcher expects sequence parameters to be provided explicitly
146
165
self .test_grpc_stream (sequence_id = sid , sequence_start = True )
147
166
sid += 1
148
- print (str (context .exception ))
149
167
self .assertTrue (
150
168
"Request is released with TRITONSERVER_REQUEST_RELEASE_RESCHEDULE"
151
169
in str (context .exception )
@@ -164,7 +182,6 @@ def test_unsupported_dynamic_scheduler(self):
164
182
)
165
183
with self .assertRaises (InferenceServerException ) as context :
166
184
self .test_grpc_stream ()
167
- print (str (context .exception ))
168
185
self .assertTrue (
169
186
"Request is released with TRITONSERVER_REQUEST_RELEASE_RESCHEDULE"
170
187
in str (context .exception )
0 commit comments