11#!/usr/bin/env python3
22
3- # Copyright 2018-2025 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ # Copyright 2018-2024 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44#
55# Redistribution and use in source and binary forms, with or without
66# modification, are permitted provided that the following conditions
@@ -1367,13 +1367,11 @@ def shm_basic_infer(
13671367 big_shm_name = "" ,
13681368 big_shm_size = 64 ,
13691369 default_shm_byte_size = 64 ,
1370- register_offset = 0 ,
13711370 shm_output_offset = 0 ,
13721371 shm_output_byte_size = 64 ,
13731372 protocol = "http" ,
13741373 use_system_shared_memory = False ,
13751374 use_cuda_shared_memory = False ,
1376- override_model_name = None ,
13771375):
13781376 # Lazy shm imports...
13791377 if use_system_shared_memory :
@@ -1383,34 +1381,20 @@ def shm_basic_infer(
13831381 else :
13841382 raise Exception ("No shared memory type specified" )
13851383
1386- if override_model_name is None :
1387- model_name = "simple"
1388- else :
1389- model_name = override_model_name
1390-
1391- if model_name .startswith ("libtorch" ):
1392- output_names = ["OUTPUT__0" , "OUTPUT__1" ]
1393- else :
1394- output_names = ["OUTPUT0" , "OUTPUT1" ]
1395-
13961384 input0_data = np .arange (start = 0 , stop = 16 , dtype = np .int32 )
13971385 input1_data = np .ones (shape = 16 , dtype = np .int32 )
13981386 inputs = []
13991387 outputs = []
14001388 if protocol == "http" :
14011389 inputs .append (httpclient .InferInput ("INPUT0" , [1 , 16 ], "INT32" ))
14021390 inputs .append (httpclient .InferInput ("INPUT1" , [1 , 16 ], "INT32" ))
1403- outputs .append (
1404- httpclient .InferRequestedOutput (output_names [0 ], binary_data = True )
1405- )
1406- outputs .append (
1407- httpclient .InferRequestedOutput (output_names [1 ], binary_data = False )
1408- )
1391+ outputs .append (httpclient .InferRequestedOutput ("OUTPUT0" , binary_data = True ))
1392+ outputs .append (httpclient .InferRequestedOutput ("OUTPUT1" , binary_data = False ))
14091393 else :
14101394 inputs .append (grpcclient .InferInput ("INPUT0" , [1 , 16 ], "INT32" ))
14111395 inputs .append (grpcclient .InferInput ("INPUT1" , [1 , 16 ], "INT32" ))
1412- outputs .append (grpcclient .InferRequestedOutput (output_names [ 0 ] ))
1413- outputs .append (grpcclient .InferRequestedOutput (output_names [ 1 ] ))
1396+ outputs .append (grpcclient .InferRequestedOutput ("OUTPUT0" ))
1397+ outputs .append (grpcclient .InferRequestedOutput ("OUTPUT1" ))
14141398
14151399 inputs [0 ].set_shared_memory ("input0_data" , default_shm_byte_size )
14161400
@@ -1430,9 +1414,9 @@ def shm_basic_infer(
14301414
14311415 try :
14321416 results = triton_client .infer (
1433- model_name , inputs , model_version = "" , outputs = outputs
1417+ "simple" , inputs , model_version = "" , outputs = outputs
14341418 )
1435- output = results .get_output (output_names [ 0 ] )
1419+ output = results .get_output ("OUTPUT0" )
14361420 if protocol == "http" :
14371421 output_datatype = output ["datatype" ]
14381422 output_shape = output ["shape" ]
@@ -1443,16 +1427,11 @@ def shm_basic_infer(
14431427
14441428 if use_system_shared_memory :
14451429 output_data = shm .get_contents_as_numpy (
1446- shm_op0_handle ,
1447- output_dtype ,
1448- output_shape ,
1449- offset = register_offset + shm_output_offset ,
1430+ shm_op0_handle , output_dtype , output_shape
14501431 )
14511432 elif use_cuda_shared_memory :
14521433 output_data = cudashm .get_contents_as_numpy (
1453- shm_op0_handle ,
1454- output_dtype ,
1455- output_shape ,
1434+ shm_op0_handle , output_dtype , output_shape
14561435 )
14571436
14581437 tester .assertTrue (
0 commit comments