Skip to content

Commit 21b3e5f

Browse files
committed
remove onnxmsrtnext backend
1 parent fb23bcc commit 21b3e5f

File tree

4 files changed

+6
-33
lines changed

4 files changed

+6
-33
lines changed

tests/backend_test_base.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,8 @@ def run_onnxcaffe2(self, onnx_graph, inputs):
5555
results = prepared_backend.run(inputs)
5656
return results
5757

58-
def run_onnxmsrtnext(self, model_path, inputs, output_names):
59-
"""Run test against msrt-next backend."""
60-
import lotus
61-
m = lotus.InferenceSession(model_path)
62-
results = m.run(output_names, inputs)
63-
return results
64-
6558
def run_onnxruntime(self, model_path, inputs, output_names):
66-
"""Run test against msrt-next backend."""
59+
"""Run test against onnxruntime backend."""
6760
import onnxruntime as rt
6861
m = rt.InferenceSession(model_path)
6962
results = m.run(output_names, inputs)
@@ -73,9 +66,7 @@ def run_backend(self, g, outputs, input_dict):
7366
model_proto = g.make_model("test")
7467
model_path = self.save_onnx_model(model_proto, input_dict)
7568

76-
if self.config.backend == "onnxmsrtnext":
77-
y = self.run_onnxmsrtnext(model_path, input_dict, outputs)
78-
elif self.config.backend == "onnxruntime":
69+
if self.config.backend == "onnxruntime":
7970
y = self.run_onnxruntime(model_path, input_dict, outputs)
8071
elif self.config.backend == "caffe2":
8172
y = self.run_onnxcaffe2(model_proto, input_dict)

tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def load():
102102
if "pytest" not in sys.argv[0]:
103103
parser = argparse.ArgumentParser()
104104
parser.add_argument("--backend", default=config.backend,
105-
choices=["caffe2", "onnxmsrtnext", "onnxruntime"],
105+
choices=["caffe2", "onnxruntime"],
106106
help="backend to test against")
107107
parser.add_argument("--opset", type=int, default=config.opset, help="opset to test against")
108108
parser.add_argument("--target", default=",".join(config.target), choices=constants.POSSIBLE_TARGETS,

tests/run_pretrained_models.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -163,21 +163,8 @@ def run_caffe2(self, name, model_proto, inputs):
163163
self.onnx_runtime = time.time() - start
164164
return results
165165

166-
def run_onnxmsrtnext(self, name, model_proto, inputs):
167-
"""Run test against msrt-next backend."""
168-
import lotus
169-
model_path = utils.save_onnx_model(TEMP_DIR, name, inputs, model_proto)
170-
m = lotus.InferenceSession(model_path)
171-
results = m.run(self.output_names, inputs)
172-
if self.perf:
173-
start = time.time()
174-
for _ in range(PERFITER):
175-
_ = m.run(self.output_names, inputs)
176-
self.onnx_runtime = time.time() - start
177-
return results
178-
179166
def run_onnxruntime(self, name, model_proto, inputs):
180-
"""Run test against msrt-next backend."""
167+
"""Run test against onnxruntime backend."""
181168
import onnxruntime as rt
182169
model_path = utils.save_onnx_model(TEMP_DIR, name, inputs, model_proto, include_test_data=True)
183170
logger.info("Model saved to %s", model_path)
@@ -279,8 +266,6 @@ def run_test(self, name, backend="caffe2", onnx_file=None, opset=None, extra_ops
279266
onnx_results = None
280267
if backend == "caffe2":
281268
onnx_results = self.run_caffe2(name, model_proto, inputs)
282-
elif backend == "onnxmsrtnext":
283-
onnx_results = self.run_onnxmsrtnext(name, model_proto, inputs)
284269
elif backend == "onnxruntime":
285270
onnx_results = self.run_onnxruntime(name, model_proto, inputs)
286271
else:
@@ -316,7 +301,7 @@ def get_args():
316301
parser.add_argument("--tests", help="tests to run")
317302
parser.add_argument("--target", default="", help="target platform")
318303
parser.add_argument("--backend", default="onnxruntime",
319-
choices=["caffe2", "onnxmsrtnext", "onnxruntime"], help="backend to use")
304+
choices=["caffe2", "onnxruntime"], help="backend to use")
320305
parser.add_argument("--opset", type=int, default=None, help="opset to use")
321306
parser.add_argument("--extra_opset", default=None,
322307
help="extra opset with format like domain:version, e.g. com.microsoft:1")

tests/test_backend.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ def test_placeholder_with_default_use_feed(self):
512512
def test_add_bcast(self):
513513
x1_val = np.array([1.0, 2.0, -3.0, -4.0], dtype=np.float32).reshape((2, 2))
514514
x2_val = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], dtype=np.float32).reshape((2, 2, 2))
515-
# if we'd broadcast 2,2 to 2,1 onnxmsrt will fail
516515
x1 = tf.placeholder(tf.float32, x1_val.shape, name="input")
517516
x2 = tf.placeholder(tf.float32, x2_val.shape, name=_TFINPUT1)
518517
x_ = tf.add(x1, x2)
@@ -830,8 +829,6 @@ def test_reshape_int(self):
830829
_ = tf.identity(x_, name=_TFOUTPUT)
831830
self._run_test_case([_OUTPUT], {_INPUT: x_val}, check_shape=True)
832831

833-
@unittest.skipIf(get_test_config().opset < 5 or get_test_config().backend in ["onnxmsrtnext"],
834-
"since opset 5, broken in msrtnext")
835832
@check_opset_min_version(6, "cast")
836833
def test_reshape_dynamic(self):
837834
x_val = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float32).reshape((2, 2))
@@ -1025,7 +1022,7 @@ def test_slice_with_size_is_negative_one(self):
10251022

10261023
@skip_caffe2_backend()
10271024
def test_slice1(self):
1028-
# FIXME: only 1 dimension supported by caffe2 and msrt
1025+
# FIXME: only 1 dimension supported by caffe2
10291026
x_val = np.array([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]], [[5, 5, 5], [6, 6, 6]]], dtype=np.float32)
10301027
t1 = tf.constant([1, 0, 0], dtype=tf.int32)
10311028
t2 = tf.constant([1, 1, 3], dtype=tf.int32)

0 commit comments

Comments
 (0)