[GitHub] [incubator-tvm] hello-hzb commented on issue #2954: [RFC][AUTOTVM] Auto-Schedule from Compute Declaration

2019-11-10 Thread GitBox
hello-hzb commented on issue #2954: [RFC][AUTOTVM] Auto-Schedule from Compute 
Declaration
URL: https://github.com/apache/incubator-tvm/issues/2954#issuecomment-552306982
 
 
   @merrymercy 
   Hi Zheng,
   My team has paied attension to your auto-scheduler work for a few days. No 
update for a few month. How is it going these days?
   Why don't you merge the autoshceduler to the master branch of TVM?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4277: [ARM][Topi] Improving Int8 Perf in Spatial Conv2D schedule.

2019-11-10 Thread GitBox
FrozenGene commented on a change in pull request #4277: [ARM][Topi] Improving 
Int8 Perf in Spatial Conv2D schedule.
URL: https://github.com/apache/incubator-tvm/pull/4277#discussion_r344568267
 
 

 ##
 File path: topi/python/topi/arm_cpu/conv2d_spatial_pack.py
 ##
 @@ -93,24 +93,35 @@ def conv2d_spatial_pack_nchw(cfg, data, kernel, strides, 
padding, dilation,
 ovshape = (N, CO // VC, OH // VH, OW // VW, VH, VW, VC)
 oshape = (N, CO, OH, OW)
 
+# For Integer convs, upcasting to int16 leads to faster implementation
+# because LLVM is able to better interleave vmlal.s16 and vldr 
instructions,
+# leading to higher CPU utilization.
+adjusted_dtype = data.dtype
+if 'int8' in data.dtype and 'int8' in kernel.dtype and out_dtype == 
'int32':
+adjusted_dtype = 'int16'
+
 if dilation_h != 1 or dilation_w != 1:
 # undilate input data
 dvshape = (N, OH // VH, OW // VW, CI, KH, KW, VH, VW)
 data_vec = tvm.compute(dvshape, lambda n, h, w, ci, kh, kw, vh, vw:
data_pad[n][ci][(h*VH+vh)*HSTR+kh*dilation_h]
-   [(w*VW+vw)*WSTR+kw*dilation_w],
+   
[(w*VW+vw)*WSTR+kw*dilation_w].astype(adjusted_dtype),
name='data_vec_undilated')
 else:
 dvshape = (N, OH // VH, OW // VW, CI, VH*HSTR + KH-1, VW*WSTR + KW-1)
 data_vec = tvm.compute(dvshape, lambda n, h, w, ci, vh, vw:
-   data_pad[n][ci][h*VH*HSTR+vh][w*VW*WSTR+vw],
+   
data_pad[n][ci][h*VH*HSTR+vh][w*VW*WSTR+vw].astype(adjusted_dtype),
name='data_vec')
 
 if pre_packed:
 kernel_vec = kernel
+if adjusted_dtype != kernel.dtype:
+kernel_vec = tvm.compute(kvshape, lambda co, ci, kh, kw, vc:
 
 Review comment:
   we only do parallel for kernel_vec before, however, we introduce one compute 
now, better way is compute_inline. Could you try this schedule:
   ```
   s[kernel_vec].unroll(kh)
   s[kernel_vec].unroll(kw)
   s[kernel_vec].vectorize(vc)
   s[kernel_vec].parallel(co)
   s[kernel_vec].compute_inline()
   ```
   Which is used in our schedule internally and could produce SMLAL instruction 
when to cast into int16. However, I can not make sure whether to work here, 
because our computation and schedule is not the same.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] yzhliu commented on issue #4083: [tutorial] Relay pass infra tutorial

2019-11-10 Thread GitBox
yzhliu commented on issue #4083: [tutorial] Relay pass infra tutorial
URL: https://github.com/apache/incubator-tvm/pull/4083#issuecomment-552304594
 
 
   Thanks @zhiics @billzorn @MarisaKirisame @yongwww 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] yzhliu merged pull request #4083: [tutorial] Relay pass infra tutorial

2019-11-10 Thread GitBox
yzhliu merged pull request #4083: [tutorial] Relay pass infra tutorial
URL: https://github.com/apache/incubator-tvm/pull/4083
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-tvm] branch master updated (1d24366 -> cff62bd)

2019-11-10 Thread liuyizhi
This is an automated email from the ASF dual-hosted git repository.

liuyizhi pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 1d24366  [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout 
transformation. (#4249)
 add cff62bd  [tutorial] Relay pass infra tutorial (#4083)

No new revisions were added by this update.

Summary of changes:
 include/tvm/relay/transform.h |   4 +-
 python/tvm/relay/transform.py |   9 +-
 src/relay/pass/print_ir.cc|   4 +-
 tutorials/dev/relay_pass_infra.py | 255 ++
 4 files changed, 267 insertions(+), 5 deletions(-)
 create mode 100644 tutorials/dev/relay_pass_infra.py



[GitHub] [incubator-tvm] jwfromm commented on a change in pull request #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
jwfromm commented on a change in pull request #4271: [Relay][Frontend][ONNX] 
operator support: DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#discussion_r344565585
 
 

 ##
 File path: tests/python/frontend/onnx/test_forward.py
 ##
 @@ -77,22 +77,27 @@ def get_tvm_output(graph_def, input_data, target, ctx, 
output_shape=None, output
 return tvm_output.asnumpy()
 
 
-def get_caffe2_output(model, x, dtype='float32'):
-import caffe2.python.onnx.backend
-prepared_backend = caffe2.python.onnx.backend.prepare(model)
-W = {model.graph.input[0].name: x.astype(dtype)}
-c2_out = prepared_backend.run(W)[0]
-return c2_out
+def get_onnxruntime_output(model, x, dtype='float32'):
+import onnxruntime.backend
+rep = onnxruntime.backend.prepare(model, 'CPU')
+x = x.astype(dtype)
+ort_out = rep.run(x)[0]
+return ort_out
 
 
 def verify_onnx_forward_impl(graph_file, data_shape, out_shape):
 dtype = 'float32'
 x = np.random.uniform(size=data_shape)
 model = onnx.load_model(graph_file)
-c2_out = get_caffe2_output(model, x, dtype)
-for target, ctx in ctx_list():
-tvm_out = get_tvm_output(model, x, target, ctx, out_shape, dtype)
-tvm.testing.assert_allclose(c2_out, tvm_out, rtol=1e-5, atol=1e-5)
+try:
+c2_out = get_onnxruntime_output(model, x, dtype)
+except onnx.onnx_cpp2py_export.checker.ValidationError as e:
 
 Review comment:
   Last one I promise, but I don't think we want to be doing try excepts here. 
If tests fail its important to throw an error so it can be fixed and won't 
sneak into the master branch. Did you need to add this because you were hitting 
ValidationErrors?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4277: [ARM][Topi] Improving Int8 Perf in Spatial Conv2D schedule.

2019-11-10 Thread GitBox
FrozenGene commented on a change in pull request #4277: [ARM][Topi] Improving 
Int8 Perf in Spatial Conv2D schedule.
URL: https://github.com/apache/incubator-tvm/pull/4277#discussion_r344559034
 
 

 ##
 File path: topi/python/topi/arm_cpu/conv2d_spatial_pack.py
 ##
 @@ -93,24 +93,35 @@ def conv2d_spatial_pack_nchw(cfg, data, kernel, strides, 
padding, dilation,
 ovshape = (N, CO // VC, OH // VH, OW // VW, VH, VW, VC)
 oshape = (N, CO, OH, OW)
 
+# For Integer convs, upcasting to int16 leads to faster implementation
+# because LLVM is able to better interleave vmlal.s16 and vldr 
instructions,
+# leading to higher CPU utilization.
+adjusted_dtype = data.dtype
+if 'int8' in data.dtype and 'int8' in kernel.dtype and out_dtype == 
'int32':
 
 Review comment:
   should cover uint8?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] cchung100m commented on a change in pull request #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
cchung100m commented on a change in pull request #4271: [Relay][Frontend][ONNX] 
operator support: DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#discussion_r344558194
 
 

 ##
 File path: tests/python/frontend/onnx/test_forward.py
 ##
 @@ -85,6 +85,13 @@ def get_caffe2_output(model, x, dtype='float32'):
 return c2_out
 
 
+def get_onnxruntime_output(model, x, dtype='float32'):
+import onnxruntime.backend
+rep = onnxruntime.backend.prepare(model, 'CPU')
+ort_out = rep.run(x)[0]
 
 Review comment:
   Thanks for the review and the issue had been updated.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] yongwww opened a new pull request #4301: [TF][TEST] add test_forward_reduce_any back

2019-11-10 Thread GitBox
yongwww opened a new pull request #4301: [TF][TEST] add test_forward_reduce_any 
back
URL: https://github.com/apache/incubator-tvm/pull/4301
 
 
   the test case was removed in #4181 for some reason
   @tqchen @soiferj @zhiics 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] jwfromm commented on a change in pull request #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
jwfromm commented on a change in pull request #4271: [Relay][Frontend][ONNX] 
operator support: DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#discussion_r344549188
 
 

 ##
 File path: tests/python/frontend/onnx/test_forward.py
 ##
 @@ -85,6 +85,13 @@ def get_caffe2_output(model, x, dtype='float32'):
 return c2_out
 
 Review comment:
   Let's just remove the caffe2 runtime and use onnxruntime everywhere instead. 
Although we could do it in a later PR, we might as well do it now.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
tqchen commented on a change in pull request #4289: [RUNTIME][REFACTOR] Use 
object protocol to support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#discussion_r344549075
 
 

 ##
 File path: include/tvm/runtime/module.h
 ##
 @@ -71,7 +70,11 @@ class Module {
* \note Cyclic dependency is not allowed among modules,
*  An error will be thrown when cyclic dependency is detected.
*/
-  TVM_DLL void Import(Module other);
 
 Review comment:
   The DLL function was moved to the Node class


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
tqchen commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to 
support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#issuecomment-552281875
 
 
   after thinking a bit more, i agree that ObjectInternal could indeed be a 
better name, I just pushed a change to do the rename, thanks @junrushao1994 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
tqchen commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to 
support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#issuecomment-552280462
 
 
   I thought a bit about Object::Internal, but eventually chose the name 
FFIUtil because it also has a name for runtime::Module.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] jwfromm edited a comment on issue #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
jwfromm edited a comment on issue #4271: [Relay][Frontend][ONNX] operator 
support: DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#issuecomment-552280147
 
 
   I've added onnxruntime to the docker image in PR #4299. Once it's merged and 
the CI image is rebuilt the tests in this PR should be able to pass.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] jwfromm commented on issue #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
jwfromm commented on issue #4271: [Relay][Frontend][ONNX] operator support: 
DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#issuecomment-552280147
 
 
   I've added onnxruntime to the docker image in PR #4299. Once it's merged the 
tests in this PR should be able to pass.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] jwfromm opened a new pull request #4299: [CI] Add onnxruntime to CI Image

2019-11-10 Thread GitBox
jwfromm opened a new pull request #4299: [CI] Add onnxruntime to CI Image
URL: https://github.com/apache/incubator-tvm/pull/4299
 
 
   As discussed in PR #4271, using the caffe runtime for our onnx testing is 
not a good long term solution due to lack of op support. Instead, we should be 
using the onnxruntime. This PR adds onnxruntime to the onnx installation docker 
image and replaces the caffe2 backend with onnxruntime in our frontend tests. 
For this to pass CI, @tqchen will need to rebuild the testing image.
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] junrushao1994 commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
junrushao1994 commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol 
to support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#issuecomment-552277277
 
 
   @tqchen The use case of the class `FFIUtil` makes sense to me now, but I 
think it would be great to have a better name to demonstrate its use case. What 
about something like `ObjectInternal`?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] yzhliu commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation.

2019-11-10 Thread GitBox
yzhliu commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to 
NCHW layout transformation.
URL: https://github.com/apache/incubator-tvm/pull/4249#issuecomment-552275667
 
 
   Thanks @anijain2305 @FrozenGene @jackwish @tqchen 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] yzhliu merged pull request #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation.

2019-11-10 Thread GitBox
yzhliu merged pull request #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to 
NCHW layout transformation.
URL: https://github.com/apache/incubator-tvm/pull/4249
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-tvm] branch master updated: [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation. (#4249)

2019-11-10 Thread liuyizhi
This is an automated email from the ASF dual-hosted git repository.

liuyizhi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
 new 1d24366  [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout 
transformation. (#4249)
1d24366 is described below

commit 1d2436647bffdcbb1e133b55dc4c7365f604fc3d
Author: Animesh Jain 
AuthorDate: Sun Nov 10 19:09:16 2019 -0800

[TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation. 
(#4249)
---
 tests/python/relay/test_pass_alter_op_layout.py |  62 +++
 tests/python/relay/test_pass_legalize.py|  44 
 topi/python/topi/arm_cpu/conv2d.py  | 130 
 3 files changed, 129 insertions(+), 107 deletions(-)

diff --git a/tests/python/relay/test_pass_alter_op_layout.py 
b/tests/python/relay/test_pass_alter_op_layout.py
index f1200ec..2738690 100644
--- a/tests/python/relay/test_pass_alter_op_layout.py
+++ b/tests/python/relay/test_pass_alter_op_layout.py
@@ -916,6 +916,67 @@ def test_alter_layout_sum():
 assert analysis.alpha_equal(a, b), "Actual = \n" + str(a)
 
 
+def test_alter_layout_nhwc_nchw_arm():
+""" Check NHWC to NHCW conversion for a small sequence of ops."""
+# Register alter op layout. "level" is used to override the previously 
registered functions.
+@register_alter_op_layout("nn.conv2d", level=115)
+def alter_conv2d(attrs, inputs, tinfos):
+from topi.arm_cpu.conv2d import _alter_conv2d_layout_arm
+return _alter_conv2d_layout_arm(attrs, inputs, tinfos, tvm.relay)
+
+# Check NHWC conversion.
+def before_nhwc():
+x = relay.var("x", shape=(1, 56, 56, 64))
+weight1 = relay.var('weight1', shape=(3, 3, 64, 64))
+weight2 = relay.var('weight2', shape=(3, 3, 64, 64))
+y = relay.nn.conv2d(x, weight1,
+channels=64,
+kernel_size=(3, 3),
+data_layout='NHWC',
+kernel_layout='HWIO')
+y = relay.nn.relu(y)
+y = relay.nn.avg_pool2d(y,
+pool_size=(1,1),
+layout='NHWC')
+y = relay.nn.conv2d(y, weight2,
+channels=64,
+kernel_size=(3, 3),
+data_layout='NHWC',
+kernel_layout='HWIO')
+y = relay.nn.relu(y)
+y = relay.Function(analysis.free_vars(y), y)
+return y
+
+def expected_nhwc():
+x = relay.var("x", shape=(1, 56, 56, 64))
+weight1 = relay.var('weight1', shape=(3, 3, 64, 64))
+weight2 = relay.var('weight2', shape=(3, 3, 64, 64))
+y = relay.layout_transform(x, "NHWC", "NCHW")
+weight1 = relay.layout_transform(weight1, "HWIO", "OIHW")
+weight2 = relay.layout_transform(weight2, "HWIO", "OIHW")
+y = relay.nn.conv2d(y, weight1,
+channels=64,
+kernel_size=(3, 3))
+y = relay.nn.relu(y)
+y = relay.nn.avg_pool2d(y,
+pool_size=(1,1))
+y = relay.nn.conv2d(y, weight2,
+channels=64,
+kernel_size=(3, 3))
+y = relay.nn.relu(y)
+y = relay.layout_transform(y, "NCHW", "NHWC")
+y = relay.Function(analysis.free_vars(y), y)
+return y
+
+a = before_nhwc()
+a = run_opt_pass(a, transform.AlterOpLayout())
+
+b = expected_nhwc()
+b = run_opt_pass(b, transform.InferType())
+
+assert analysis.alpha_equal(a, b), "Actual = \n" + str(a)
+
+
 if __name__ == "__main__":
 test_alter_op()
 test_alter_return_none()
@@ -932,3 +993,4 @@ if __name__ == "__main__":
 test_alter_layout_pad()
 test_alter_layout_pool()
 test_alter_layout_sum()
+test_alter_layout_nhwc_nchw_arm()
diff --git a/tests/python/relay/test_pass_legalize.py 
b/tests/python/relay/test_pass_legalize.py
index c5303ef..2f0fbee 100644
--- a/tests/python/relay/test_pass_legalize.py
+++ b/tests/python/relay/test_pass_legalize.py
@@ -171,53 +171,9 @@ def test_legalize_multi_input():
 
 assert analysis.alpha_equal(a, b), "Actual = \n" + str(a)
 
-def test_legalize_arm_layout_functional():
-"""Test if the legalized conversion yields same result as original"""
-def get_output(func, data_val, parameters):
-with relay.build_config(opt_level=0):
-graph, lib, params = relay.build(func, target='llvm', 
params=parameters)
-m = graph_runtime.create(graph, lib, tvm.cpu())
-m.set_input("data", data_val)
-m.set_input(**params)
-m.run()
-out = m.get_output(0, tvm.nd.empty((1, 224, 224, 32), 
'float32')).asnumpy()
-return out
-
-def before():
-n, ic, ih, iw, oc, kh, kw = 1, 16, 224, 

[GitHub] [incubator-tvm] yzhliu edited a comment on issue #4259: [DEV][DRAFT] TVM v0.6 Release candidate

2019-11-10 Thread GitBox
yzhliu edited a comment on issue #4259: [DEV][DRAFT] TVM v0.6 Release candidate
URL: https://github.com/apache/incubator-tvm/issues/4259#issuecomment-550417287
 
 
   # Build and Test
   * Increate the robuteness of CI test 
([#2841](https://github.com/dmlc/tvm/pull/2841), 
[#2798](https://github.com/dmlc/tvm/pull/2798), 
[#2793](https://github.com/dmlc/tvm/pull/2793), 
[#2788](https://github.com/dmlc/tvm/pull/2788), 
[#2781](https://github.com/dmlc/tvm/pull/2781), 
[#2727](https://github.com/dmlc/tvm/pull/2727), 
[#2710](https://github.com/dmlc/tvm/pull/2710), 
[#2711](https://github.com/dmlc/tvm/pull/2711), 
[#2923](https://github.com/dmlc/tvm/pull/2923))
   * Improve conda build ([#2742](https://github.com/dmlc/tvm/pull/2742)) 
   * Add caffe2 nnvm frontend to CI (#3018)
   * Use bridge network and expose port on macOS when launch docker image 
(#3086)
   * Run DarkNet tests (#2673) 
   * Add file type check (#3116)
   * Always run cpptest during build to ensure library correctness 
([#3147](https://github.com/dmlc/tvm/pull/3147))
   * Handle more file types in ASF header 
([#3235](https://github.com/dmlc/tvm/pull/3235))
   * Add `test_forward_ssd_mobilenet_v1` to tflite/test_forward 
([#3350](https://github.com/dmlc/tvm/pull/3350))
   * Add Azure build pipeline ([#3458](https://github.com/dmlc/tvm/pull/3458), 
[#3459](https://github.com/dmlc/tvm/pull/3459))
   * Update ci-gpu to v0.52 ([#3374](https://github.com/dmlc/tvm/pull/3374))
   * Enable more visible symbols by default 
([#3365](https://github.com/dmlc/tvm/pull/3365))
   * Separate out legacy as a stage in CI 
([#3337](https://github.com/dmlc/tvm/pull/3337))
   * Simplify build script, remove python 2 support  
([#3419](https://github.com/dmlc/tvm/pull/3419))
   * Ignore rust cargo lock files in rat 
([#3314](https://github.com/dmlc/tvm/pull/3314))
   * Improve CUDA Conda package build 
([#3281](https://github.com/dmlc/tvm/pull/3281))
   * Update CMakeLists.txt to be more flexible to find the third parties 
libraries ([#3354](https://github.com/dmlc/tvm/pull/3354))
   * Docker update conda package 
([#3344](https://github.com/dmlc/tvm/pull/3344)), requests and pillow 
([#3495](https://github.com/dmlc/tvm/pull/3495)), Android demo 
([#3499](https://github.com/dmlc/tvm/pull/3499)), rat install 
([#3527](https://github.com/dmlc/tvm/pull/3527)), ARM support 
([#3546](https://github.com/dmlc/tvm/pull/3546)), LLVM 
([#3590](https://github.com/dmlc/tvm/pull/3590))
   * Relay-to-Python testing ([#3156](https://github.com/dmlc/tvm/pull/3156))
   * Code refactoring/remove ([#3523](https://github.com/dmlc/tvm/pull/3523), 
[#3667](https://github.com/dmlc/tvm/pull/3667))
   * Zero-rank testing ([#3612](https://github.com/dmlc/tvm/pull/3612))
   * CMake compilation ([#3611](https://github.com/dmlc/tvm/pull/3611), 
[#3650](https://github.com/dmlc/tvm/pull/3650), google test 
[#3628](https://github.com/dmlc/tvm/pull/3628))
   * Standalone wheel build for TOPI 
([#3657](https://github.com/dmlc/tvm/pull/3657))
   * Fixing performance issues in PassUpDomain when fusing and splitting axes 
([#3073](https://github.com/dmlc/tvm/pull/3073))
   * conda recipe ([#3791](https://github.com/dmlc/tvm/pull/3791))
   * Allow users to specify download directory 
([#3803](https://github.com/dmlc/tvm/pull/3803))
   * Update docs for installation for CUDA 
([#3832](https://github.com/dmlc/tvm/pull/3832))
   * Update hybrid_script.rst ([#3799](https://github.com/dmlc/tvm/pull/3799))
   * Acknowledge Halide attributions 
([#3824](https://github.com/dmlc/tvm/pull/3824))
   * Add psutil dependency ([#3780](https://github.com/dmlc/tvm/pull/3780))
   * Temporary disable rust test 
([#3809](https://github.com/dmlc/tvm/pull/3809))
   * Solve occasional CI issue when pad value is all 0 
([#3801](https://github.com/dmlc/tvm/pull/3801))
   * Towards TSIM CI testing ([#3704](https://github.com/dmlc/tvm/pull/3704))
   * Use pip3 for python3 ([#3742](https://github.com/dmlc/tvm/pull/3742))
   * Update docker image `ci_cpu,i386` to include verilator 
([#3738](https://github.com/dmlc/tvm/pull/3738))
   * Remove sccache from Rust install 
([#3728](https://github.com/dmlc/tvm/pull/3728))
   * Update dmlc-core to the latest commit 
([#3716](https://github.com/dmlc/tvm/pull/3716))
   * Update GPU docker ([#3709](https://github.com/dmlc/tvm/pull/3709))
   * Add an option to build with -pthread 
([#3671](https://github.com/dmlc/tvm/pull/3671))
   * Add DGL to `{ci_gpu, demo_cpu, demo_gpu}` docker images 
([#3692](https://github.com/dmlc/tvm/pull/3692))
   * Use pytest instead of nosetest 
([#3524](https://github.com/dmlc/tvm/pull/3524))
   * Enable NHWC of `relay.testing.mobilenet` 
([#3886](https://github.com/dmlc/tvm/pull/3886))
   * Add .hsaco save/load for tesnor_expr Tutorial 
([#3852](https://github.com/dmlc/tvm/pull/3852))
   * Support LLVM trunk ([#3907](https://github.com/dmlc/tvm/pull/3907))
   * Remove GTest cmake flag from install docs 
([#3953](https://github.com/dmlc/tvm/pull/3953))
   

[GitHub] [incubator-tvm] yzhliu removed a comment on issue #4259: [DEV][DRAFT] TVM v0.6 Release candidate

2019-11-10 Thread GitBox
yzhliu removed a comment on issue #4259: [DEV][DRAFT] TVM v0.6 Release candidate
URL: https://github.com/apache/incubator-tvm/issues/4259#issuecomment-552266647
 
 
   # Build and Test
   * Increate the robuteness of CI test 
([#2841](https://github.com/dmlc/tvm/pull/2841), 
[#2798](https://github.com/dmlc/tvm/pull/2798), 
[#2793](https://github.com/dmlc/tvm/pull/2793), 
[#2788](https://github.com/dmlc/tvm/pull/2788), 
[#2781](https://github.com/dmlc/tvm/pull/2781), 
[#2727](https://github.com/dmlc/tvm/pull/2727), 
[#2710](https://github.com/dmlc/tvm/pull/2710), 
[#2711](https://github.com/dmlc/tvm/pull/2711), 
[#2923](https://github.com/dmlc/tvm/pull/2923))
   * Improve conda build ([#2742](https://github.com/dmlc/tvm/pull/2742)) 
   * Add caffe2 nnvm frontend to CI (#3018)
   * Use bridge network and expose port on macOS when launch docker image 
(#3086)
   * Run DarkNet tests (#2673) 
   * Add file type check (#3116)
   * Always run cpptest during build to ensure library correctness 
([#3147](https://github.com/dmlc/tvm/pull/3147))
   * Handle more file types in ASF header 
([#3235](https://github.com/dmlc/tvm/pull/3235))
   * Add `test_forward_ssd_mobilenet_v1` to tflite/test_forward 
([#3350](https://github.com/dmlc/tvm/pull/3350))
   * Add Azure build pipeline ([#3458](https://github.com/dmlc/tvm/pull/3458), 
[#3459](https://github.com/dmlc/tvm/pull/3459))
   * Update ci-gpu to v0.52 ([#3374](https://github.com/dmlc/tvm/pull/3374))
   * Enable more visible symbols by default 
([#3365](https://github.com/dmlc/tvm/pull/3365))
   * Separate out legacy as a stage in CI 
([#3337](https://github.com/dmlc/tvm/pull/3337))
   * Simplify build script, remove python 2 support  
([#3419](https://github.com/dmlc/tvm/pull/3419))
   * Ignore rust cargo lock files in rat 
([#3314](https://github.com/dmlc/tvm/pull/3314))
   * Improve CUDA Conda package build 
([#3281](https://github.com/dmlc/tvm/pull/3281))
   * Update CMakeLists.txt to be more flexible to find the third parties 
libraries ([#3354](https://github.com/dmlc/tvm/pull/3354))
   * Docker update conda package 
([#3344](https://github.com/dmlc/tvm/pull/3344)), requests and pillow 
([#3495](https://github.com/dmlc/tvm/pull/3495)), Android demo 
([#3499](https://github.com/dmlc/tvm/pull/3499)), rat install 
([#3527](https://github.com/dmlc/tvm/pull/3527)), ARM support 
([#3546](https://github.com/dmlc/tvm/pull/3546)), LLVM 
([#3590](https://github.com/dmlc/tvm/pull/3590))
   * Relay-to-Python testing ([#3156](https://github.com/dmlc/tvm/pull/3156))
   * Code refactoring/remove ([#3523](https://github.com/dmlc/tvm/pull/3523), 
[#3667](https://github.com/dmlc/tvm/pull/3667))
   * Zero-rank testing ([#3612](https://github.com/dmlc/tvm/pull/3612))
   * CMake compilation ([#3611](https://github.com/dmlc/tvm/pull/3611), 
[#3650](https://github.com/dmlc/tvm/pull/3650), google test 
[#3628](https://github.com/dmlc/tvm/pull/3628))
   * Standalone wheel build for TOPI 
([#3657](https://github.com/dmlc/tvm/pull/3657))
   * Fixing performance issues in PassUpDomain when fusing and splitting axes 
([#3073](https://github.com/dmlc/tvm/pull/3073))
   * conda recipe ([#3791](https://github.com/dmlc/tvm/pull/3791))
   * Allow users to specify download directory 
([#3803](https://github.com/dmlc/tvm/pull/3803))
   * Update docs for installation for CUDA 
([#3832](https://github.com/dmlc/tvm/pull/3832))
   * Update hybrid_script.rst ([#3799](https://github.com/dmlc/tvm/pull/3799))
   * Acknowledge Halide attributions 
([#3824](https://github.com/dmlc/tvm/pull/3824))
   * Add psutil dependency ([#3780](https://github.com/dmlc/tvm/pull/3780))
   * Temporary disable rust test 
([#3809](https://github.com/dmlc/tvm/pull/3809))
   * Solve occasional CI issue when pad value is all 0 
([#3801](https://github.com/dmlc/tvm/pull/3801))
   * Towards TSIM CI testing ([#3704](https://github.com/dmlc/tvm/pull/3704))
   * Use pip3 for python3 ([#3742](https://github.com/dmlc/tvm/pull/3742))
   * Update docker image `ci_cpu,i386` to include verilator 
([#3738](https://github.com/dmlc/tvm/pull/3738))
   * Remove sccache from Rust install 
([#3728](https://github.com/dmlc/tvm/pull/3728))
   * Update dmlc-core to the latest commit 
([#3716](https://github.com/dmlc/tvm/pull/3716))
   * Update GPU docker ([#3709](https://github.com/dmlc/tvm/pull/3709))
   * Add an option to build with -pthread 
([#3671](https://github.com/dmlc/tvm/pull/3671))
   * Add DGL to `{ci_gpu, demo_cpu, demo_gpu}` docker images 
([#3692](https://github.com/dmlc/tvm/pull/3692))
   * Use pytest instead of nosetest 
([#3524](https://github.com/dmlc/tvm/pull/3524))
   * Enable NHWC of `relay.testing.mobilenet` 
([#3886](https://github.com/dmlc/tvm/pull/3886))
   * Add .hsaco save/load for tesnor_expr Tutorial 
([#3852](https://github.com/dmlc/tvm/pull/3852))
   * Support LLVM trunk ([#3907](https://github.com/dmlc/tvm/pull/3907))
   * Remove GTest cmake flag from install docs 
([#3953](https://github.com/dmlc/tvm/pull/3953))
   

[GitHub] [incubator-tvm] yzhliu commented on issue #4259: [DEV][DRAFT] TVM v0.6 Release candidate

2019-11-10 Thread GitBox
yzhliu commented on issue #4259: [DEV][DRAFT] TVM v0.6 Release candidate
URL: https://github.com/apache/incubator-tvm/issues/4259#issuecomment-552266647
 
 
   # Build and Test
   * Increate the robuteness of CI test 
([#2841](https://github.com/dmlc/tvm/pull/2841), 
[#2798](https://github.com/dmlc/tvm/pull/2798), 
[#2793](https://github.com/dmlc/tvm/pull/2793), 
[#2788](https://github.com/dmlc/tvm/pull/2788), 
[#2781](https://github.com/dmlc/tvm/pull/2781), 
[#2727](https://github.com/dmlc/tvm/pull/2727), 
[#2710](https://github.com/dmlc/tvm/pull/2710), 
[#2711](https://github.com/dmlc/tvm/pull/2711), 
[#2923](https://github.com/dmlc/tvm/pull/2923))
   * Improve conda build ([#2742](https://github.com/dmlc/tvm/pull/2742)) 
   * Add caffe2 nnvm frontend to CI (#3018)
   * Use bridge network and expose port on macOS when launch docker image 
(#3086)
   * Run DarkNet tests (#2673) 
   * Add file type check (#3116)
   * Always run cpptest during build to ensure library correctness 
([#3147](https://github.com/dmlc/tvm/pull/3147))
   * Handle more file types in ASF header 
([#3235](https://github.com/dmlc/tvm/pull/3235))
   * Add `test_forward_ssd_mobilenet_v1` to tflite/test_forward 
([#3350](https://github.com/dmlc/tvm/pull/3350))
   * Add Azure build pipeline ([#3458](https://github.com/dmlc/tvm/pull/3458), 
[#3459](https://github.com/dmlc/tvm/pull/3459))
   * Update ci-gpu to v0.52 ([#3374](https://github.com/dmlc/tvm/pull/3374))
   * Enable more visible symbols by default 
([#3365](https://github.com/dmlc/tvm/pull/3365))
   * Separate out legacy as a stage in CI 
([#3337](https://github.com/dmlc/tvm/pull/3337))
   * Simplify build script, remove python 2 support  
([#3419](https://github.com/dmlc/tvm/pull/3419))
   * Ignore rust cargo lock files in rat 
([#3314](https://github.com/dmlc/tvm/pull/3314))
   * Improve CUDA Conda package build 
([#3281](https://github.com/dmlc/tvm/pull/3281))
   * Update CMakeLists.txt to be more flexible to find the third parties 
libraries ([#3354](https://github.com/dmlc/tvm/pull/3354))
   * Docker update conda package 
([#3344](https://github.com/dmlc/tvm/pull/3344)), requests and pillow 
([#3495](https://github.com/dmlc/tvm/pull/3495)), Android demo 
([#3499](https://github.com/dmlc/tvm/pull/3499)), rat install 
([#3527](https://github.com/dmlc/tvm/pull/3527)), ARM support 
([#3546](https://github.com/dmlc/tvm/pull/3546)), LLVM 
([#3590](https://github.com/dmlc/tvm/pull/3590))
   * Relay-to-Python testing ([#3156](https://github.com/dmlc/tvm/pull/3156))
   * Code refactoring/remove ([#3523](https://github.com/dmlc/tvm/pull/3523), 
[#3667](https://github.com/dmlc/tvm/pull/3667))
   * Zero-rank testing ([#3612](https://github.com/dmlc/tvm/pull/3612))
   * CMake compilation ([#3611](https://github.com/dmlc/tvm/pull/3611), 
[#3650](https://github.com/dmlc/tvm/pull/3650), google test 
[#3628](https://github.com/dmlc/tvm/pull/3628))
   * Standalone wheel build for TOPI 
([#3657](https://github.com/dmlc/tvm/pull/3657))
   * Fixing performance issues in PassUpDomain when fusing and splitting axes 
([#3073](https://github.com/dmlc/tvm/pull/3073))
   * conda recipe ([#3791](https://github.com/dmlc/tvm/pull/3791))
   * Allow users to specify download directory 
([#3803](https://github.com/dmlc/tvm/pull/3803))
   * Update docs for installation for CUDA 
([#3832](https://github.com/dmlc/tvm/pull/3832))
   * Update hybrid_script.rst ([#3799](https://github.com/dmlc/tvm/pull/3799))
   * Acknowledge Halide attributions 
([#3824](https://github.com/dmlc/tvm/pull/3824))
   * Add psutil dependency ([#3780](https://github.com/dmlc/tvm/pull/3780))
   * Temporary disable rust test 
([#3809](https://github.com/dmlc/tvm/pull/3809))
   * Solve occasional CI issue when pad value is all 0 
([#3801](https://github.com/dmlc/tvm/pull/3801))
   * Towards TSIM CI testing ([#3704](https://github.com/dmlc/tvm/pull/3704))
   * Use pip3 for python3 ([#3742](https://github.com/dmlc/tvm/pull/3742))
   * Update docker image `ci_cpu,i386` to include verilator 
([#3738](https://github.com/dmlc/tvm/pull/3738))
   * Remove sccache from Rust install 
([#3728](https://github.com/dmlc/tvm/pull/3728))
   * Update dmlc-core to the latest commit 
([#3716](https://github.com/dmlc/tvm/pull/3716))
   * Update GPU docker ([#3709](https://github.com/dmlc/tvm/pull/3709))
   * Add an option to build with -pthread 
([#3671](https://github.com/dmlc/tvm/pull/3671))
   * Add DGL to `{ci_gpu, demo_cpu, demo_gpu}` docker images 
([#3692](https://github.com/dmlc/tvm/pull/3692))
   * Use pytest instead of nosetest 
([#3524](https://github.com/dmlc/tvm/pull/3524))
   * Enable NHWC of `relay.testing.mobilenet` 
([#3886](https://github.com/dmlc/tvm/pull/3886))
   * Add .hsaco save/load for tesnor_expr Tutorial 
([#3852](https://github.com/dmlc/tvm/pull/3852))
   * Support LLVM trunk ([#3907](https://github.com/dmlc/tvm/pull/3907))
   * Remove GTest cmake flag from install docs 
([#3953](https://github.com/dmlc/tvm/pull/3953))
   * Allow 

[GitHub] [incubator-tvm] jackwish commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation.

2019-11-10 Thread GitBox
jackwish commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to 
NCHW layout transformation.
URL: https://github.com/apache/incubator-tvm/pull/4249#issuecomment-552263685
 
 
   That sounds good, thank you :) @anijain2305 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
tqchen commented on issue #4289: [RUNTIME][REFACTOR] Use object protocol to 
support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#issuecomment-552255958
 
 
   The main reason for the ffi_util.h is to keep these functionalities 
internal, as we do not want to expose these protected field of objects in most 
cases.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
junrushao1994 commented on a change in pull request #4289: [RUNTIME][REFACTOR] 
Use object protocol to support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#discussion_r344525003
 
 

 ##
 File path: src/runtime/micro/tcl_socket.h
 ##
 @@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2019 by Contributors
 
 Review comment:
   What happened to this line...


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #4289: [RUNTIME][REFACTOR] Use object protocol to support runtime::Module

2019-11-10 Thread GitBox
junrushao1994 commented on a change in pull request #4289: [RUNTIME][REFACTOR] 
Use object protocol to support runtime::Module
URL: https://github.com/apache/incubator-tvm/pull/4289#discussion_r344524435
 
 

 ##
 File path: include/tvm/runtime/module.h
 ##
 @@ -71,7 +70,11 @@ class Module {
* \note Cyclic dependency is not allowed among modules,
*  An error will be thrown when cyclic dependency is detected.
*/
-  TVM_DLL void Import(Module other);
 
 Review comment:
   Do we intentionally remove the TVM_DLL here?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-tvm] branch master updated (2f65a87 -> d2fc025)

2019-11-10 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 2f65a87  [TFLite] Support PRelu (#4298)
 add d2fc025  [RUTNIME] Support C++ RPC (#4281)

No new revisions were added by this update.

Summary of changes:
 apps/{rocm_rpc => cpp_rpc}/Makefile|  35 +-
 apps/cpp_rpc/README.md |  56 
 apps/cpp_rpc/main.cc   | 265 +++
 apps/cpp_rpc/rpc_env.cc| 254 +++
 apps/cpp_rpc/rpc_env.h |  80 +
 apps/cpp_rpc/rpc_server.cc | 359 +
 apps/cpp_rpc/rpc_server.h  |  52 +++
 apps/cpp_rpc/rpc_tracker_client.h  | 246 ++
 src/common/socket.h| 187 ++-
 src/common/util.h  | 158 +
 src/runtime/rpc/rpc_session.h  |  19 ++
 .../vulkan_module.h => rpc/rpc_socket_impl.h}  |  24 +-
 12 files changed, 1711 insertions(+), 24 deletions(-)
 copy apps/{rocm_rpc => cpp_rpc}/Makefile (63%)
 create mode 100644 apps/cpp_rpc/README.md
 create mode 100644 apps/cpp_rpc/main.cc
 create mode 100644 apps/cpp_rpc/rpc_env.cc
 create mode 100644 apps/cpp_rpc/rpc_env.h
 create mode 100644 apps/cpp_rpc/rpc_server.cc
 create mode 100644 apps/cpp_rpc/rpc_server.h
 create mode 100644 apps/cpp_rpc/rpc_tracker_client.h
 create mode 100644 src/common/util.h
 copy src/runtime/{vulkan/vulkan_module.h => rpc/rpc_socket_impl.h} (70%)



[GitHub] [incubator-tvm] tqchen commented on issue #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
tqchen commented on issue #4281: [RUTNIME] Support C++ RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#issuecomment-552244083
 
 
   Thanks @FrozenGene @weberlo !


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen merged pull request #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
tqchen merged pull request #4281: [RUTNIME] Support C++ RPC
URL: https://github.com/apache/incubator-tvm/pull/4281
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] junrushao1994 commented on issue #4275: imp module is deprecated

2019-11-10 Thread GitBox
junrushao1994 commented on issue #4275: imp module is deprecated
URL: https://github.com/apache/incubator-tvm/pull/4275#issuecomment-552227157
 
 
   Seems like your PR failed on an irrelevant place, so feel free to re-trigger 
it.
   
   BTW, I saw there is usage of `import imp` as well in 
topi/python/topi/cpp.py:21. Could you also fix this if it is easy?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-tvm] branch master updated (fc28f7a -> 2f65a87)

2019-11-10 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from fc28f7a  [Test][TF][Relay] Fix argument preparation for vm test mode 
(#4296)
 add 2f65a87  [TFLite] Support PRelu (#4298)

No new revisions were added by this update.

Summary of changes:
 python/tvm/relay/frontend/tflite.py  | 26 +-
 tests/python/frontend/tflite/test_forward.py | 14 ++
 2 files changed, 39 insertions(+), 1 deletion(-)



[GitHub] [incubator-tvm] tqchen commented on issue #4298: [TFLite] Support PRelu

2019-11-10 Thread GitBox
tqchen commented on issue #4298: [TFLite] Support PRelu
URL: https://github.com/apache/incubator-tvm/pull/4298#issuecomment-552226928
 
 
   Thanks @FrozenGene 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen merged pull request #4298: [TFLite] Support PRelu

2019-11-10 Thread GitBox
tqchen merged pull request #4298: [TFLite] Support PRelu
URL: https://github.com/apache/incubator-tvm/pull/4298
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] anijain2305 commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation.

2019-11-10 Thread GitBox
anijain2305 commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC 
to NCHW layout transformation.
URL: https://github.com/apache/incubator-tvm/pull/4249#issuecomment-55356
 
 
   > Thanks for your detailed explanation @anijain2305 ! I missed you change of 
removing legalization.
   > 
   > AFAIK, AlterOpLayout is not always enabled for different _opt level_, in 
which case the NHWC computing may encounter build failure. Not sure 
AlterOpLayout is a good solution for all cases.
   
   That is a good point. But, even Legalize is enabled at opt_level >= 1. 
AlterOpLayout is enabled at opt_level = 3. So, I think this is ok. As tq said, 
I think we should work on the Explicit layout Convertor Pass to solve the 
opt_level problem separately. I have some thoughts on that and take that task 
up.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-tvm] branch master updated (801cf0e -> fc28f7a)

2019-11-10 Thread zhic
This is an automated email from the ASF dual-hosted git repository.

zhic pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git.


from 801cf0e  [Codegen][cuda-fp16] fallback to fp32 simulation when cuda 
arch < sm53 (#4268)
 add fc28f7a  [Test][TF][Relay] Fix argument preparation for vm test mode 
(#4296)

No new revisions were added by this update.

Summary of changes:
 tests/python/frontend/tensorflow/test_forward.py | 29 
 1 file changed, 19 insertions(+), 10 deletions(-)



[GitHub] [incubator-tvm] zhiics merged pull request #4296: [Test][TF][Relay] Fix argument preparation for vm test mode

2019-11-10 Thread GitBox
zhiics merged pull request #4296: [Test][TF][Relay] Fix argument preparation 
for vm test mode
URL: https://github.com/apache/incubator-tvm/pull/4296
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on issue #4277: [ARM][Topi] Improving Int8 Perf in Spatial Conv2D schedule.

2019-11-10 Thread GitBox
tqchen commented on issue #4277: [ARM][Topi] Improving Int8 Perf in Spatial 
Conv2D schedule.
URL: https://github.com/apache/incubator-tvm/pull/4277#issuecomment-552219578
 
 
   @ajtulloch it would be great if you can manage this PR, you should have the 
permission to approve and merge


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to NCHW layout transformation.

2019-11-10 Thread GitBox
tqchen commented on issue #4249: [TOPI][AlterOpLayout][ARM] Enabling NHWC to 
NCHW layout transformation.
URL: https://github.com/apache/incubator-tvm/pull/4249#issuecomment-552219192
 
 
   I think we want an explicit LayoutConvert pass besides the automatic one to 
give developer more flexibility in the future


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on issue #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene commented on issue #4281: [RUTNIME] Support C++ RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#issuecomment-552219131
 
 
   @tqchen Have resolved LOG(ERROR) -> LOG(FATAL) and gnulib issue.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene edited a comment on issue #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene edited a comment on issue #4281: [RUTNIME] Support C++ RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#issuecomment-552219131
 
 
   @tqchen Have resolved LOG(ERROR) -> LOG(FATAL) and gnulib issue. Please 
review again


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ 
RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#discussion_r344506405
 
 

 ##
 File path: src/common/util.h
 ##
 @@ -61,6 +65,41 @@ inline int TVMPClose(FILE* stream) {
   return pclose(stream);
 #endif
 }
+
+/*
+ * gnulib sys_wait.h.in says on Windows
 
 Review comment:
   done


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ 
RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#discussion_r344506400
 
 

 ##
 File path: apps/cpp_rpc/rpc_env.cc
 ##
 @@ -164,8 +163,11 @@ void LinuxShared(const std::string output,
  cmd += " " + *f;
 }
 cmd += " " + options;
-std::string executed_result = common::Execute(cmd);
-CHECK(executed_result.length() == 0) << executed_result;
+std::string err_msg;
+auto executed_status = common::Execute(cmd, err_msg);
+if (executed_status) {
+  LOG(ERROR) << err_msg;
 
 Review comment:
   done


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on issue #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
tqchen commented on issue #4271: [Relay][Frontend][ONNX] operator support: 
DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#issuecomment-552218937
 
 
   The procedure will be add onnxruntime dep to the 
docker/install/install_ubuntu_onnx.sh, then we will rebuild and verify the 
images, merge it to the master before we update the test. if you can send a PR 
to add onnxruntime installation(with a specific version), I will work on the 
docker image update incoming week


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
tqchen commented on a change in pull request #4281: [RUTNIME] Support C++ RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#discussion_r344506148
 
 

 ##
 File path: src/common/util.h
 ##
 @@ -61,6 +65,41 @@ inline int TVMPClose(FILE* stream) {
   return pclose(stream);
 #endif
 }
+
+/*
+ * gnulib sys_wait.h.in says on Windows
 
 Review comment:
   To be on the safe side(license), I think we should avoid mention gnulib if 
you created the status handling code by yourself


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene opened a new pull request #4298: [TFLite] Support PRelu

2019-11-10 Thread GitBox
FrozenGene opened a new pull request #4298: [TFLite] Support PRelu
URL: https://github.com/apache/incubator-tvm/pull/4298
 
 
   As discuss forum topic: 
https://discuss.tvm.ai/t/missing-tflite-operators/3150/8, we want to have PRelu 
support in TFLite
   
   @apivovarov 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] icemelon9 commented on a change in pull request #4158: [PERF] Parallelize reduction for CPU

2019-11-10 Thread GitBox
icemelon9 commented on a change in pull request #4158: [PERF] Parallelize 
reduction for CPU
URL: https://github.com/apache/incubator-tvm/pull/4158#discussion_r344504236
 
 

 ##
 File path: topi/python/topi/x86/reduction.py
 ##
 @@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=invalid-name
+"""x86 declaration and schedules."""
+from __future__ import absolute_import as _abs
+import tvm
+from .. import tag
+from .. import generic
+
+
+def _schedule_reduce(sch, out, is_idx_reduce=False):
+if len(sch[out].op.axis) >= 5:
+fused = sch[out].fuse(sch[out].op.axis[0], sch[out].op.axis[1], 
sch[out].op.axis[2])
+sch[out].parallel(fused)
+elif len(sch[out].op.axis) >= 3:
+fused = sch[out].fuse(sch[out].op.axis[0], sch[out].op.axis[1], 
sch[out].op.axis[2])
+sch[out].parallel(fused)
+elif len(sch[out].op.axis) >= 1:
+sch[out].parallel(sch[out].op.axis[0])
+
+
+@generic.schedule_reduce.register(["cpu"])
+def schedule_reduce(outs):
+outs = [outs] if isinstance(outs, tvm.tensor.Tensor) else outs
+sch = tvm.create_schedule([x.op for x in outs])
+scheduled_ops = []
+
+def traverse_before_reduce(operator):
+"""Internal travserse function"""
+if isinstance(operator, tvm.tensor.PlaceholderOp):
+return
+if tag.is_injective(operator.tag):
+sch[operator].compute_inline()
+for tensor in operator.input_tensors:
+if tensor.op not in scheduled_ops:
+traverse_before_reduce(tensor.op)
+else:
+raise RuntimeError("Unsupported operator: %s" % operator.tag)
+
+scheduled_ops.append(operator)
+
+def traverse_after_reduce(operator):
+"""Internal travserse function"""
+if tag.is_broadcast(operator.tag):
+if operator not in scheduled_ops:
+generic.schedule_injective_from_existing(sch, operator)
+for tensor in operator.input_tensors:
+traverse_after_reduce(tensor.op)
+elif operator.tag == 'comm_reduce':
+_schedule_reduce(sch, operator, is_idx_reduce=False)
+for tensor in operator.input_tensors:
+if tensor.op not in scheduled_ops:
+traverse_before_reduce(tensor.op)
+elif operator.tag == 'comm_reduce_idx':
+_schedule_reduce(sch, operator, is_idx_reduce=True)
+input_tensors = operator.input_tensors[0].op.input_tensors
+for tensor in input_tensors:
+if tensor.op not in scheduled_ops:
+traverse_before_reduce(tensor.op)
+else:
+raise RuntimeError("Unsupported operator: %s" % operator.tag)
+
+scheduled_ops.append(operator)
+
+traverse_after_reduce(outs[0].op)
+return sch
+
 
 Review comment:
   this is necessary


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] icemelon9 commented on a change in pull request #4158: [PERF] Parallelize reduction for CPU

2019-11-10 Thread GitBox
icemelon9 commented on a change in pull request #4158: [PERF] Parallelize 
reduction for CPU
URL: https://github.com/apache/incubator-tvm/pull/4158#discussion_r344504230
 
 

 ##
 File path: topi/python/topi/x86/reduction.py
 ##
 @@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint: disable=invalid-name
+"""x86 declaration and schedules."""
+from __future__ import absolute_import as _abs
+import tvm
+from .. import tag
+from .. import generic
+
+
+def _schedule_reduce(sch, out, is_idx_reduce=False):
 
 Review comment:
   fixed


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] cchung100m commented on issue #4283: Add support for quant. mul operator in tflite frontend

2019-11-10 Thread GitBox
cchung100m commented on issue #4283: Add support for quant. mul operator in 
tflite frontend
URL: https://github.com/apache/incubator-tvm/pull/4283#issuecomment-552193779
 
 
   Hi @inadob 
   
   Should we add the test case for `quant.mul `operator in tflite frontend?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene opened a new pull request #4297: [OP] Support Faster-RCNN Proposal OP on CPU.

2019-11-10 Thread GitBox
FrozenGene opened a new pull request #4297: [OP] Support Faster-RCNN Proposal 
OP on CPU.
URL: https://github.com/apache/incubator-tvm/pull/4297
 
 
   Currently, our TVM only implement proposal op on CUDA. However, we should 
support Proposal op on CPU too. 
   
   @vinx13 @tqchen please help to review it.
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on issue #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene commented on issue #4281: [RUTNIME] Support C++ RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#issuecomment-552174191
 
 
   @tqchen @weberlo I should resolve all the comments. Please review again.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] jackwish edited a comment on issue #4277: [ARM][Topi] Improving Int8 Perf in Spatial Conv2D schedule.

2019-11-10 Thread GitBox
jackwish edited a comment on issue #4277: [ARM][Topi] Improving Int8 Perf in 
Spatial Conv2D schedule.
URL: https://github.com/apache/incubator-tvm/pull/4277#issuecomment-552174176
 
 
   Thanks for your kind explanation @anijain2305 . That is exactly my 
consideration as the legalization approach may confuse tensorie implementation. 
In this case, I vote for changing the schedule.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] jackwish commented on issue #4277: [ARM][Topi] Improving Int8 Perf in Spatial Conv2D schedule.

2019-11-10 Thread GitBox
jackwish commented on issue #4277: [ARM][Topi] Improving Int8 Perf in Spatial 
Conv2D schedule.
URL: https://github.com/apache/incubator-tvm/pull/4277#issuecomment-552174176
 
 
   Thanks for your kind explanation @anijain2305 . That is exactly my 
consideration as the legalization approach may confuse tensorie implementation.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ 
RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#discussion_r344478767
 
 

 ##
 File path: apps/cpp_rpc/rpc_env.cc
 ##
 @@ -0,0 +1,247 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file rpc_env.cc
+ * \brief Server environment of the RPC.
+ */
+#include 
+#include 
+#ifndef _MSC_VER
+#include 
+#include 
+#include 
+#else
+#include 
+#endif
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "rpc_env.h"
+#include "../../src/common/util.h"
+#include "../../src/runtime/file_util.h"
+
+namespace tvm {
+namespace runtime {
+
+RPCEnv::RPCEnv() {
+  #if defined(__linux__) || defined(__ANDROID__)
+base_ = "./rpc";
+mkdir(_[0], 0777);
+
+TVM_REGISTER_GLOBAL("tvm.rpc.server.workpath")
+.set_body([](TVMArgs args, TVMRetValue* rv) {
+static RPCEnv env;
+*rv = env.GetPath(args[0]);
+  });
+
+TVM_REGISTER_GLOBAL("tvm.rpc.server.load_module")
+.set_body([](TVMArgs args, TVMRetValue *rv) {
+static RPCEnv env;
+std::string file_name = env.GetPath(args[0]);
+*rv = Load(_name, "");
+LOG(INFO) << "Load module from " << file_name << " ...";
+  });
+  #else
+LOG(FATAL) << "Only support RPC in linux environment";
+  #endif
+}
+/*!
+ * \brief GetPath To get the workpath from packed function
+ * \param name The file name
+ * \return The full path of file.
+ */
+std::string RPCEnv::GetPath(std::string file_name) {
+  // we assume file_name has "/" means file_name is the exact path
+  // and does not create /.rpc/
+  if (file_name.find("/") != std::string::npos) {
+return file_name;
+  } else {
+return base_ + "/" + file_name;
+  }
+}
+/*!
+ * \brief Remove The RPC Environment cleanup function
+ */
+void RPCEnv::CleanUp() {
+  #if defined(__linux__) || defined(__ANDROID__)
+CleanDir(_[0]);
+int ret = rmdir(_[0]);
+if (ret != 0) {
+  LOG(WARNING) << "Remove directory " << base_ << " failed";
+}
+  #else
+LOG(FATAL) << "Only support RPC in linux environment";
+  #endif
+}
+
+/*!
+ * \brief ListDir get the list of files in a directory
+ * \param dirname The root directory name
+ * \return vector Files in directory.
+ */
+std::vector ListDir(const std::string ) {
+  std::vector vec;
+  #ifndef _MSC_VER
+DIR *dp = opendir(dirname.c_str());
+if (dp == NULL) {
+  int errsv = errno;
+  LOG(FATAL) << "ListDir " << dirname <<" error: " << strerror(errsv);
+}
+dirent *d;
+while ((d = readdir(dp)) != NULL) {
+  std::string filename = d->d_name;
+  if (filename != "." && filename != "..") {
+std::string f = dirname;
+if (f[f.length() - 1] != '/') {
+  f += '/';
+}
+f += d->d_name;
+vec.push_back(f);
+  }
+}
+closedir(dp);
+  #else
+WIN32_FIND_DATA fd;
+std::string pattern = dirname + "/*";
+HANDLE handle = FindFirstFile(pattern.c_str(), );
+if (handle == INVALID_HANDLE_VALUE) {
+  int errsv = GetLastError();
+  LOG(FATAL) << "ListDir " << dirname << " error: " << strerror(errsv);
+}
+do {
+  if (fd.cFileName != "." && fd.cFileName != "..") {
+std::string  f = dirname;
+char clast = f[f.length() - 1];
+if (f == ".") {
+  f = fd.cFileName;
+} else if (clast != '/' && clast != '\\') {
+  f += '/';
+  f += fd.cFileName;
+}
+vec.push_back(f);
+  }
+}  while (FindNextFile(handle, ));
+FindClose(handle);
+  #endif
+  return vec;
+}
+
+/*!
+ * \brief LinuxShared Creates a linux shared library
+ * \param output The output file name
+ * \param files The files for building
+ * \param options The compiler options
+ * \param cc The compiler
+ */
+void LinuxShared(const std::string output,
+ const std::vector ,
+ std::string options = "",
+ std::string cc = "g++") {
+std::string cmd = cc;
+cmd += " -shared -fPIC ";
+cmd += " -o " + output;
+for (auto f = files.begin(); f != files.end(); ++f) {
+ cmd += " " + *f;
+}
+cmd += " " + options;
+

[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ RPC

2019-11-10 Thread GitBox
FrozenGene commented on a change in pull request #4281: [RUTNIME] Support C++ 
RPC
URL: https://github.com/apache/incubator-tvm/pull/4281#discussion_r344478615
 
 

 ##
 File path: src/runtime/rpc/rpc_session.h
 ##
 @@ -36,8 +36,29 @@
 namespace tvm {
 namespace runtime {
 
+// Magic header for RPC data plane
 const int kRPCMagic = 0xff271;
+// magic header for RPC tracker(control plane)
+const int kRPCTrackerMagic = 0x2f271;
+// sucess response
+const int kRPCSuccess = kRPCMagic + 0;
+// duplicate key in proxy
+const int kRPCDupicate = kRPCMagic + 1;
 
 Review comment:
   It is used for proxy mode. However, this PR doesn't implement proxy in fact, 
so I remove related unnecessary code, currently work like our java standalone 
server. 


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-tvm] cchung100m commented on issue #4271: [Relay][Frontend][ONNX] operator support: DepthToSpace, SpaceToDepth

2019-11-10 Thread GitBox
cchung100m commented on issue #4271: [Relay][Frontend][ONNX] operator support: 
DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#issuecomment-552173389
 
 
   Hi @jwfromm 
   
   Thanks for the prompt reply.
   
   I agree that we can use the `onnxruntime` to test onnx model, therefore, I 
add the helper function `get_onnxruntime_output` to test `SpaceToDepth`.  The 
code is tested successfully with `onnxruntime 0.5.0` in my localhost and it 
would be great if we can add the onnxruntime in CI pipeline.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services