@@ -205,7 +205,7 @@ def test_parse_error_modelfail(self):
205
205
206
206
# And other models should be loaded successfully
207
207
try :
208
- for base_name in ["onnx" ]:
208
+ for base_name in ["openvino" , " onnx" ]:
209
209
for triton_client in (
210
210
httpclient .InferenceServerClient ("localhost:8000" , verbose = True ),
211
211
grpcclient .InferenceServerClient ("localhost:8001" , verbose = True ),
@@ -268,7 +268,7 @@ def test_parse_error_modelfail_nostrict(self):
268
268
269
269
# And other models should be loaded successfully
270
270
try :
271
- for base_name in ["onnx" ]:
271
+ for base_name in ["openvino" , " onnx" ]:
272
272
for triton_client in (
273
273
httpclient .InferenceServerClient ("localhost:8000" , verbose = True ),
274
274
grpcclient .InferenceServerClient ("localhost:8001" , verbose = True ),
@@ -301,7 +301,7 @@ def test_parse_error_no_model_config(self):
301
301
):
302
302
try :
303
303
model_name = tu .get_model_name (
304
- "libtorch " , np .float32 , np .float32 , np .float32
304
+ "openvino " , np .float32 , np .float32 , np .float32
305
305
)
306
306
307
307
# expecting ready because not strict readiness
@@ -318,13 +318,13 @@ def test_parse_error_no_model_config(self):
318
318
319
319
except Exception as ex :
320
320
self .assertIn (
321
- "Request for unknown model: 'libtorch_float32_float32_float32 ' is not found" ,
321
+ "Request for unknown model: 'openvino_float32_float32_float32 ' is not found" ,
322
322
ex .message (),
323
323
)
324
324
325
325
# And other models should be loaded successfully
326
326
try :
327
- for base_name in ["onnx" ]:
327
+ for base_name in ["libtorch" , " onnx" ]:
328
328
model_name = tu .get_model_name (
329
329
base_name , np .float32 , np .float32 , np .float32
330
330
)
@@ -365,7 +365,7 @@ def test_init_error_modelfail(self):
365
365
366
366
# And other models should be loaded successfully
367
367
try :
368
- for base_name in ["onnx" ]:
368
+ for base_name in ["openvino" , "libtorch" , " onnx" ]:
369
369
model_name = tu .get_model_name (
370
370
base_name , np .float32 , np .float32 , np .float32
371
371
)
@@ -375,7 +375,7 @@ def test_init_error_modelfail(self):
375
375
376
376
try :
377
377
tensor_shape = (1 , 16 )
378
- for base_name in ["onnx" ]:
378
+ for base_name in ["openvino" , "libtorch" , " onnx" ]:
379
379
iu .infer_exact (
380
380
self ,
381
381
base_name ,
@@ -403,15 +403,15 @@ def test_parse_error_model_no_version(self):
403
403
self .assertFalse (triton_client .is_server_ready ())
404
404
405
405
model_name = tu .get_model_name (
406
- "libtorch " , np .float32 , np .float32 , np .float32
406
+ "openvino " , np .float32 , np .float32 , np .float32
407
407
)
408
408
self .assertFalse (triton_client .is_model_ready (model_name ))
409
409
except Exception as ex :
410
410
self .assertTrue (False , "unexpected error {}" .format (ex ))
411
411
412
412
# Sanity check that other models are loaded properly
413
413
try :
414
- for base_name in ["onnx" ]:
414
+ for base_name in ["libtorch" , " onnx" ]:
415
415
model_name = tu .get_model_name (
416
416
base_name , np .float32 , np .float32 , np .float32
417
417
)
@@ -425,7 +425,7 @@ def test_parse_error_model_no_version(self):
425
425
self .assertTrue (False , "unexpected error {}" .format (ex ))
426
426
427
427
try :
428
- for base_name in ["onnx" ]:
428
+ for base_name in ["libtorch" , " onnx" ]:
429
429
iu .infer_exact (
430
430
self ,
431
431
base_name ,
@@ -453,12 +453,12 @@ def test_parse_error_model_no_version(self):
453
453
454
454
try :
455
455
iu .infer_exact (
456
- self , "libtorch " , tensor_shape , 1 , np .float32 , np .float32 , np .float32
456
+ self , "openvino " , tensor_shape , 1 , np .float32 , np .float32 , np .float32
457
457
)
458
458
self .assertTrue (False , "expected error for unavailable model " + model_name )
459
459
except Exception as ex :
460
460
self .assertIn (
461
- "Request for unknown model: 'libtorch_float32_float32_float32 ' has no available versions" ,
461
+ "Request for unknown model: 'openvino_float32_float32_float32 ' has no available versions" ,
462
462
ex .message (),
463
463
)
464
464
@@ -475,7 +475,7 @@ def test_parse_ignore_zero_prefixed_version(self):
475
475
self .assertTrue (triton_client .is_server_ready ())
476
476
477
477
model_name = tu .get_model_name (
478
- "onnx " , np .float32 , np .float32 , np .float32
478
+ "libtorch " , np .float32 , np .float32 , np .float32
479
479
)
480
480
self .assertTrue (triton_client .is_model_ready (model_name , "1" ))
481
481
except Exception as ex :
@@ -485,7 +485,7 @@ def test_parse_ignore_zero_prefixed_version(self):
485
485
# swap=False for version 1
486
486
iu .infer_exact (
487
487
self ,
488
- "onnx " ,
488
+ "libtorch " ,
489
489
tensor_shape ,
490
490
1 ,
491
491
np .float32 ,
@@ -509,7 +509,7 @@ def test_parse_ignore_non_intergral_version(self):
509
509
self .assertTrue (triton_client .is_server_ready ())
510
510
511
511
model_name = tu .get_model_name (
512
- "onnx " , np .float32 , np .float32 , np .float32
512
+ "libtorch " , np .float32 , np .float32 , np .float32
513
513
)
514
514
self .assertTrue (triton_client .is_model_ready (model_name , "1" ))
515
515
except Exception as ex :
@@ -519,7 +519,7 @@ def test_parse_ignore_non_intergral_version(self):
519
519
# swap=False for version 1
520
520
iu .infer_exact (
521
521
self ,
522
- "onnx " ,
522
+ "libtorch " ,
523
523
tensor_shape ,
524
524
1 ,
525
525
np .float32 ,
@@ -1043,13 +1043,13 @@ def test_dynamic_version_load_unload_disabled(self):
1043
1043
self .assertTrue (False , "unexpected error {}" .format (ex ))
1044
1044
1045
1045
def test_dynamic_model_modify (self ):
1046
- models_base = " plan"
1046
+ models_base = ( "libtorch" , " plan")
1047
1047
models_shape = ((1 , 16 ), (1 , 16 ))
1048
1048
models = list ()
1049
1049
for m in models_base :
1050
1050
models .append (tu .get_model_name (m , np .float32 , np .float32 , np .float32 ))
1051
1051
1052
- # Make sure plan are in the status
1052
+ # Make sure libtorch and plan are in the status
1053
1053
for model_name in models :
1054
1054
try :
1055
1055
for triton_client in (
@@ -1170,13 +1170,13 @@ def test_dynamic_model_modify(self):
1170
1170
self .assertTrue (False , "unexpected error {}" .format (ex ))
1171
1171
1172
1172
def test_dynamic_file_delete (self ):
1173
- models_base = " plan"
1173
+ models_base = ( "onnx" , " plan")
1174
1174
models_shape = ((1 , 16 ), (1 , 16 ))
1175
1175
models = list ()
1176
1176
for m in models_base :
1177
1177
models .append (tu .get_model_name (m , np .float32 , np .float32 , np .float32 ))
1178
1178
1179
- # Make sure plan are in the status
1179
+ # Make sure onnx and plan are in the status
1180
1180
for model_name in models :
1181
1181
try :
1182
1182
for triton_client in (
@@ -1266,22 +1266,24 @@ def test_dynamic_file_delete(self):
1266
1266
1267
1267
def test_multiple_model_repository_polling (self ):
1268
1268
model_shape = (1 , 16 )
1269
- plan_name = tu .get_model_name ("plan" , np .float32 , np .float32 , np .float32 )
1269
+ libtorch_name = tu .get_model_name (
1270
+ "libtorch" , np .float32 , np .float32 , np .float32
1271
+ )
1270
1272
1271
1273
# Models should be loaded successfully and infer
1272
- # successfully. Initially plan only has version 1.
1274
+ # successfully. Initially libtorch only has version 1.
1273
1275
self ._infer_success_models (
1274
1276
[
1275
- "plan " ,
1277
+ "libtorch " ,
1276
1278
],
1277
1279
(1 ,),
1278
1280
model_shape ,
1279
1281
)
1280
- self ._infer_success_models (["libtorch " , "onnx" ], (1 , 3 ), model_shape )
1282
+ self ._infer_success_models (["openvino " , "onnx" ], (1 , 3 ), model_shape )
1281
1283
1282
- # Add the plan to the second model repository, should cause
1284
+ # Add the libtorch to the second model repository, should cause
1283
1285
# it to be unloaded due to duplication
1284
- shutil .copytree (plan_name , "models_0/" + plan_name )
1286
+ shutil .copytree (libtorch_name , "models_0/" + libtorch_name )
1285
1287
time .sleep (5 ) # wait for models to reload
1286
1288
try :
1287
1289
for triton_client in (
@@ -1290,27 +1292,31 @@ def test_multiple_model_repository_polling(self):
1290
1292
):
1291
1293
self .assertTrue (triton_client .is_server_live ())
1292
1294
self .assertTrue (triton_client .is_server_ready ())
1293
- self .assertFalse (triton_client .is_model_ready (plan_name , "1" ))
1294
- self .assertFalse (triton_client .is_model_ready (plan_name , "3" ))
1295
+ self .assertFalse (triton_client .is_model_ready (libtorch_name , "1" ))
1296
+ self .assertFalse (triton_client .is_model_ready (libtorch_name , "3" ))
1295
1297
except Exception as ex :
1296
1298
self .assertTrue (False , "unexpected error {}" .format (ex ))
1297
1299
1298
- self ._infer_success_models (["libtorch " , "onnx" ], (1 , 3 ), model_shape )
1300
+ self ._infer_success_models (["openvino " , "onnx" ], (1 , 3 ), model_shape )
1299
1301
1300
- # Remove the plan from the first model repository, the
1302
+ # Remove the libtorch from the first model repository, the
1301
1303
# model from the second model repository should be loaded
1302
- # properly. In the second model repository plan should
1304
+ # properly. In the second model repository libtorch should
1303
1305
# have versions 1 and 3.
1304
- shutil .rmtree ("models/" + plan_name )
1306
+ shutil .rmtree ("models/" + libtorch_name )
1305
1307
time .sleep (5 ) # wait for model to unload
1306
- self ._infer_success_models (["plan" , "libtorch" , "onnx" ], (1 , 3 ), model_shape )
1308
+ self ._infer_success_models (
1309
+ ["libtorch" , "openvino" , "onnx" ], (1 , 3 ), model_shape
1310
+ )
1307
1311
1308
1312
def test_multiple_model_repository_control (self ):
1309
1313
# similar to test_multiple_model_repository_polling, but the
1310
1314
# model load/unload is controlled by the API
1311
1315
model_shape = (1 , 16 )
1312
- plan_name = tu .get_model_name ("plan" , np .float32 , np .float32 , np .float32 )
1313
- model_bases = ["plan" , "libtorch" , "onnx" ]
1316
+ libtorch_name = tu .get_model_name (
1317
+ "libtorch" , np .float32 , np .float32 , np .float32
1318
+ )
1319
+ model_bases = ["libtorch" , "openvino" , "onnx" ]
1314
1320
1315
1321
# Initially models are not loaded
1316
1322
for base in model_bases :
@@ -1339,38 +1345,38 @@ def test_multiple_model_repository_control(self):
1339
1345
self .assertTrue (False , "unexpected error {}" .format (ex ))
1340
1346
1341
1347
# Models should be loaded successfully and infer
1342
- # successfully. Initially plan only has version 1.
1348
+ # successfully. Initially libtorch only has version 1.
1343
1349
self ._infer_success_models (
1344
1350
[
1345
- "plan " ,
1351
+ "libtorch " ,
1346
1352
],
1347
1353
(1 ,),
1348
1354
model_shape ,
1349
1355
)
1350
- self ._infer_success_models (["libtorch " , "onnx" ], (1 , 3 ), model_shape )
1356
+ self ._infer_success_models (["openvino " , "onnx" ], (1 , 3 ), model_shape )
1351
1357
1352
- # Add the plan to the second model repository. Because
1358
+ # Add the libtorch to the second model repository. Because
1353
1359
# not polling this doesn't change any model state, all models
1354
1360
# are still loaded and available.
1355
- shutil .copytree (plan_name , "models_0/" + plan_name )
1361
+ shutil .copytree (libtorch_name , "models_0/" + libtorch_name )
1356
1362
self ._infer_success_models (
1357
1363
[
1358
- "plan " ,
1364
+ "libtorch " ,
1359
1365
],
1360
1366
(1 ,),
1361
1367
model_shape ,
1362
1368
)
1363
- self ._infer_success_models (["libtorch " , "onnx" ], (1 , 3 ), model_shape )
1369
+ self ._infer_success_models (["openvino " , "onnx" ], (1 , 3 ), model_shape )
1364
1370
1365
- # Load plan again which should fail because it is now duplicated
1371
+ # Load libtorch again which should fail because it is now duplicated
1366
1372
# in 2 model repositories. Use HTTP here.
1367
1373
try :
1368
1374
triton_client = httpclient .InferenceServerClient (
1369
1375
"localhost:8000" , verbose = True
1370
1376
)
1371
- triton_client .load_model (plan_name )
1377
+ triton_client .load_model (libtorch_name )
1372
1378
except Exception as ex :
1373
- self .assertIn ("failed to load '{}'" .format (plan_name ), ex .message ())
1379
+ self .assertIn ("failed to load '{}'" .format (libtorch_name ), ex .message ())
1374
1380
1375
1381
try :
1376
1382
for triton_client in (
@@ -1381,32 +1387,34 @@ def test_multiple_model_repository_control(self):
1381
1387
self .assertTrue (triton_client .is_server_ready ())
1382
1388
# Unlike polling mode, the failed load on the duplicate model
1383
1389
# should NOT unload the existing versions in model control mode.
1384
- self .assertTrue (triton_client .is_model_ready (plan_name , "1" ))
1390
+ self .assertTrue (triton_client .is_model_ready (libtorch_name , "1" ))
1385
1391
# Version 3 did not exist in the first model repository, so
1386
1392
# it should still not be loaded.
1387
- self .assertFalse (triton_client .is_model_ready (plan_name , "3" ))
1393
+ self .assertFalse (triton_client .is_model_ready (libtorch_name , "3" ))
1388
1394
except Exception as ex :
1389
1395
self .assertTrue (False , "unexpected error {}" .format (ex ))
1390
1396
1391
- self ._infer_success_models (["libtorch " , "onnx" ], (1 , 3 ), model_shape )
1397
+ self ._infer_success_models (["openvino " , "onnx" ], (1 , 3 ), model_shape )
1392
1398
1393
- # Remove the plan from the first model repository and
1394
- # explicitly load plan . The plan from the second
1399
+ # Remove the libtorch from the first model repository and
1400
+ # explicitly load libtorch . The libtorch from the second
1395
1401
# model repository should be loaded properly. In the second
1396
- # model repository plan should have versions 1 and 3.
1397
- shutil .rmtree ("models/" + plan_name )
1402
+ # model repository libtorch should have versions 1 and 3.
1403
+ shutil .rmtree ("models/" + libtorch_name )
1398
1404
try :
1399
1405
triton_client = httpclient .InferenceServerClient (
1400
1406
"localhost:8000" , verbose = True
1401
1407
)
1402
1408
# Unload existing in-memory model from first model repository
1403
- triton_client .unload_model (plan_name )
1409
+ triton_client .unload_model (libtorch_name )
1404
1410
# Load model from second model repository since original was deleted
1405
- triton_client .load_model (plan_name )
1411
+ triton_client .load_model (libtorch_name )
1406
1412
except Exception as ex :
1407
- self .assertIn ("failed to load '{}'" .format (plan_name ), ex .message ())
1413
+ self .assertIn ("failed to load '{}'" .format (libtorch_name ), ex .message ())
1408
1414
1409
- self ._infer_success_models (["plan" , "libtorch" , "onnx" ], (1 , 3 ), model_shape )
1415
+ self ._infer_success_models (
1416
+ ["libtorch" , "openvino" , "onnx" ], (1 , 3 ), model_shape
1417
+ )
1410
1418
1411
1419
def test_model_control (self ):
1412
1420
model_shape = (1 , 16 )
@@ -2249,12 +2257,11 @@ def test_model_repository_index(self):
2249
2257
# use model control EXPLICIT and --load-model to load a subset of models
2250
2258
# in model repository
2251
2259
tensor_shape = (1 , 16 )
2252
- model_bases = ["libtorch" , "simple_libtorch" ]
2260
+ model_bases = ["plan" , " libtorch" , "simple_libtorch" ]
2253
2261
2254
2262
# Sanity check on loaded models
2255
- # 3 models should be loaded:
2256
- # simple_plan_float32_float32_float32
2257
- # plan_float32_float32_float32
2263
+ # 2 models should be loaded:
2264
+ # simple_libtorch_float32_float32_float32
2258
2265
# libtorch_float32_float32_float32
2259
2266
for model_base in model_bases :
2260
2267
try :
@@ -2274,7 +2281,7 @@ def test_model_repository_index(self):
2274
2281
# Check model repository index
2275
2282
# All models should be in ready state except onnx_float32_float32_float32
2276
2283
# which appears in two repositories.
2277
- model_bases .append ("simple_libtorch " )
2284
+ model_bases .append ("simple_plan " )
2278
2285
try :
2279
2286
triton_client = httpclient .InferenceServerClient (
2280
2287
"localhost:8000" , verbose = True
@@ -3398,12 +3405,12 @@ def test_shutdown_with_live_connection(self):
3398
3405
)
3399
3406
3400
3407
def test_add_custom_config (self ):
3401
- models_base = ("onnx " ,)
3408
+ models_base = ("libtorch " ,)
3402
3409
models = list ()
3403
3410
for m in models_base :
3404
3411
models .append (tu .get_model_name (m , np .float32 , np .float32 , np .float32 ))
3405
3412
3406
- # Make sure onnx and plan are in the status
3413
+ # Make sure libtorch and plan are in the status
3407
3414
for model_name in models :
3408
3415
try :
3409
3416
for triton_client in (
@@ -3444,12 +3451,12 @@ def test_add_custom_config(self):
3444
3451
self .assertTrue (False , "unexpected error {}" .format (ex ))
3445
3452
3446
3453
def test_delete_custom_config (self ):
3447
- models_base = ("onnx " ,)
3454
+ models_base = ("libtorch " ,)
3448
3455
models = list ()
3449
3456
for m in models_base :
3450
3457
models .append (tu .get_model_name (m , np .float32 , np .float32 , np .float32 ))
3451
3458
3452
- # Make sure plan is in the status
3459
+ # Make sure libtorch and plan are in the status
3453
3460
for model_name in models :
3454
3461
try :
3455
3462
for triton_client in (
0 commit comments