You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/04 23:58:07 UTC
[GitHub] [tvm] anwang2009 opened a new pull request, #10898: [ONNX] Add imports for Gelu, BiasGelu
anwang2009 opened a new pull request, #10898:
URL: https://github.com/apache/tvm/pull/10898
As title. Adds imports for Gelu, BiasGelu from the com.microsoft onnx op domain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 commented on pull request #10898: [ONNX] Add imports for Gelu, BiasGelu
Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on PR #10898:
URL: https://github.com/apache/tvm/pull/10898#issuecomment-1089716668
Thanks @anwang2009!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] mbrookhart commented on pull request #10898: [ONNX] Add imports for Gelu, BiasGelu
Posted by GitBox <gi...@apache.org>.
mbrookhart commented on PR #10898:
URL: https://github.com/apache/tvm/pull/10898#issuecomment-1089026381
Thanks @anwang2009 @sfvaroglu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] anwang2009 commented on a diff in pull request #10898: [ONNX] Add imports for Gelu, BiasGelu
Posted by GitBox <gi...@apache.org>.
anwang2009 commented on code in PR #10898:
URL: https://github.com/apache/tvm/pull/10898#discussion_r843255974
##########
tests/python/frontend/onnx/test_forward.py:
##########
@@ -5375,6 +5375,67 @@ def verify_reverse_sequence(x, sequence_lens, batch_axis, time_axis):
verify_reverse_sequence(x, sequence_lens, 1, 0)
+@tvm.testing.parametrize_targets
+def test_gelu(target, dev):
+ def verify_gelu(x):
+ node = onnx.helper.make_node(
+ "Gelu",
+ inputs=["x"],
+ outputs=["y"],
+ domain="com.microsoft",
+ )
+
+ graph = helper.make_graph(
+ [node],
+ "gelu_test",
+ inputs=[helper.make_tensor_value_info("x", TensorProto.FLOAT, list(x.shape))],
+ outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, list(x.shape))],
+ )
+
+ model = helper.make_model(graph, producer_name="gelu_test")
+ verify_with_ort_with_inputs(model, [x], [x.shape], target=target, dev=dev)
+
+ x = np.array([-1.0, 0, 1.0, 100.0, -100.0, 1000.0, -1000.0], dtype=np.float32)
+ verify_gelu(x)
+ x = np.array([[1, 2], [3, 4]], dtype=np.float32)
+ verify_gelu(x)
+
+
+@tvm.testing.parametrize_targets
+def test_biasgelu(target, dev):
+ if target != "llvm":
+ pass
Review Comment:
oops. thanks for the catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] masahi commented on a diff in pull request #10898: [ONNX] Add imports for Gelu, BiasGelu
Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #10898:
URL: https://github.com/apache/tvm/pull/10898#discussion_r843255457
##########
tests/python/frontend/onnx/test_forward.py:
##########
@@ -5375,6 +5375,67 @@ def verify_reverse_sequence(x, sequence_lens, batch_axis, time_axis):
verify_reverse_sequence(x, sequence_lens, 1, 0)
+@tvm.testing.parametrize_targets
+def test_gelu(target, dev):
+ def verify_gelu(x):
+ node = onnx.helper.make_node(
+ "Gelu",
+ inputs=["x"],
+ outputs=["y"],
+ domain="com.microsoft",
+ )
+
+ graph = helper.make_graph(
+ [node],
+ "gelu_test",
+ inputs=[helper.make_tensor_value_info("x", TensorProto.FLOAT, list(x.shape))],
+ outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, list(x.shape))],
+ )
+
+ model = helper.make_model(graph, producer_name="gelu_test")
+ verify_with_ort_with_inputs(model, [x], [x.shape], target=target, dev=dev)
+
+ x = np.array([-1.0, 0, 1.0, 100.0, -100.0, 1000.0, -1000.0], dtype=np.float32)
+ verify_gelu(x)
+ x = np.array([[1, 2], [3, 4]], dtype=np.float32)
+ verify_gelu(x)
+
+
+@tvm.testing.parametrize_targets
+def test_biasgelu(target, dev):
+ if target != "llvm":
+ pass
Review Comment:
Why skip other tests?
##########
tests/python/frontend/onnx/test_forward.py:
##########
@@ -5375,6 +5375,67 @@ def verify_reverse_sequence(x, sequence_lens, batch_axis, time_axis):
verify_reverse_sequence(x, sequence_lens, 1, 0)
+@tvm.testing.parametrize_targets
+def test_gelu(target, dev):
+ def verify_gelu(x):
+ node = onnx.helper.make_node(
+ "Gelu",
+ inputs=["x"],
+ outputs=["y"],
+ domain="com.microsoft",
+ )
+
+ graph = helper.make_graph(
+ [node],
+ "gelu_test",
+ inputs=[helper.make_tensor_value_info("x", TensorProto.FLOAT, list(x.shape))],
+ outputs=[helper.make_tensor_value_info("y", TensorProto.FLOAT, list(x.shape))],
+ )
+
+ model = helper.make_model(graph, producer_name="gelu_test")
+ verify_with_ort_with_inputs(model, [x], [x.shape], target=target, dev=dev)
+
+ x = np.array([-1.0, 0, 1.0, 100.0, -100.0, 1000.0, -1000.0], dtype=np.float32)
+ verify_gelu(x)
+ x = np.array([[1, 2], [3, 4]], dtype=np.float32)
+ verify_gelu(x)
+
+
+@tvm.testing.parametrize_targets
+def test_biasgelu(target, dev):
+ if target != "llvm":
+ pass
Review Comment:
Why skip other targets?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] anwang2009 commented on pull request #10898: [ONNX] Add imports for Gelu, BiasGelu
Posted by GitBox <gi...@apache.org>.
anwang2009 commented on PR #10898:
URL: https://github.com/apache/tvm/pull/10898#issuecomment-1088132864
cc @MargaretQian @sfvaroglu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] junrushao1994 merged pull request #10898: [ONNX] Add imports for Gelu, BiasGelu
Posted by GitBox <gi...@apache.org>.
junrushao1994 merged PR #10898:
URL: https://github.com/apache/tvm/pull/10898
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org