Skip to content

Commit ae10970

Browse files
author
Jagadeesh J
authored
Merge branch 'master' into kserve-class-rename
2 parents e0efd66 + 961b9fb commit ae10970

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

frontend/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gson_version=2.8.5
55
prometheus_version=0.9.0
66
netty_version=4.1.53.Final
77
slf4j_api_version=1.7.32
8-
slf4j_log4j_version=2.17.0
8+
slf4j_log4j_version=2.17.1
99
testng_version=7.1.0
1010
torchserve_sdk_version=0.0.4
1111
snakeyaml_version=1.8

test/pytest/profiler_utils/resnet_batch.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/pytest/test_pytorch_profiler.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import requests
1414

1515
import test_utils
16+
from concurrent import futures
1617

1718
REPO_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
1819
data_file_mnist = os.path.join(REPO_ROOT, "examples/image_classifier/mnist/test_data/1.png")
@@ -137,17 +138,22 @@ def test_batch_input(set_custom_handler, handler_name):
137138
"""
138139
Tests pytorch profiler integration with batch inference
139140
"""
141+
140142
CUSTOM_PATH = "/tmp/output/resnet-152-batch"
143+
141144
if os.path.exists(CUSTOM_PATH):
142145
shutil.rmtree(CUSTOM_PATH)
143146
assert os.path.exists(data_file_resnet)
144147

145-
cmd = ["bash", os.path.join(profiler_utils, "resnet_batch.sh")]
146-
147-
proc = subprocess.run(cmd, stdout=subprocess.PIPE, check=True, timeout=1000)
148+
def invoke_batch_input():
149+
data = open(data_file_resnet, "rb")
150+
response = requests.post("{}/predictions/resnet152".format(TF_INFERENCE_API), data)
151+
assert response.status_code == 200
152+
assert "tiger_cat" in json.loads(response.content)
148153

149-
assert "tiger_cat" in proc.stdout.decode("utf-8")
150-
assert "Labrador_retriever" in proc.stdout.decode("utf-8")
154+
with futures.ThreadPoolExecutor(2) as executor:
155+
for _ in range(2):
156+
executor.submit(invoke_batch_input)
151157

152158
assert len(glob.glob("{}/*.pt.trace.json".format(CUSTOM_PATH))) == 1
153159
test_utils.unregister_model("resnet152")

0 commit comments

Comments
 (0)