[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5719: [Object] Restore the StrMap behavior in JSON/SHash/SEqual

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5719:
URL: https://github.com/apache/incubator-tvm/pull/5719#discussion_r434314213



##
File path: include/tvm/node/container.h
##
@@ -82,6 +82,21 @@ class MapNode : public Object {
   /*! \brief the data content */
   ContainerType data;
 
+  /*!
+   * \brief Check if all keys in the MapNode are instance of the given Object 
type
+   * \tparam T The given Object type
+   * \return The result of the check
+   */
+  template 
+  bool KeysAreInstance() const {

Review comment:
   This is not so commonly used, let us make it an internal helper function 
instead, we can also use 
https://en.cppreference.com/w/cpp/algorithm/all_any_none_of





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




[GitHub] [incubator-tvm] ANSHUMAN87 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


ANSHUMAN87 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434310738



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   > Thank you for your question! H but I am not sure I understand if 
correctly. Just to confirm, "The first if condition", are you referring to 
"val.type_code() == kTVMStr" in `CanConvertFrom`? Thank you!
   
   Sorry for confusion.
   The first if condition --> if (val.IsObjectRef()) might be true 
always for String objref, so maybe the condition inside 
String::CanConvertFrom(val) will not reach.





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




[GitHub] [incubator-tvm] ANSHUMAN87 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


ANSHUMAN87 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434311351



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   > The Python frontend is still able to pass `runtime::String` back to 
C++ via packed function. One case I found in our testcases is: 
https://github.com/apache/incubator-tvm/pull/5687/files#diff-5243f3909dfa484d85d3d8471f259169R422-R424
   
   
   I think that may be because of implicit conversion of String(Overloaded) to 
std::string!





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




[GitHub] [incubator-tvm] ANSHUMAN87 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


ANSHUMAN87 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434310738



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   > Thank you for your question! H but I am not sure I understand if 
correctly. Just to confirm, "The first if condition", are you referring to 
"val.type_code() == kTVMStr" in `CanConvertFrom`? Thank you!
   
   Sorry for confusion.
   The first if condition --> if (val.IsObjectRef())





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




[GitHub] [incubator-tvm] ANSHUMAN87 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


ANSHUMAN87 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434310738



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   > Thank you for your question! H but I am not sure I understand if 
correctly. Just to confirm, "The first if condition", are you referring to 
"val.type_code() == kTVMStr" in `CanConvertFrom`? Thank you!
   Sorry for confusion.
   The first if condition --> if (val.IsObjectRef())





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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434308571



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   The Python frontend is still able to pass `runtime::String` back to C++ 
via packed function. One case I found in our testcases is: 
https://github.com/apache/incubator-tvm/pull/5687/files#diff-5243f3909dfa484d85d3d8471f259169R422-R424





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




[GitHub] [incubator-tvm] junrushao1994 edited a comment on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 edited a comment on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637902225


   Follow-up PR #5718 per our 
[discussion](https://github.com/apache/incubator-tvm/pull/5687#discussion_r434212540)
 in this thread



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




[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637952674


   Another follow-up PR #5719 that restores some unwanted change of behavior 
when `StrMap` is removed



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




[GitHub] [incubator-tvm] junrushao1994 opened a new pull request #5719: [Object] Restore the StrMap behavior in JSON/SHash/SEqual

2020-06-02 Thread GitBox


junrushao1994 opened a new pull request #5719:
URL: https://github.com/apache/incubator-tvm/pull/5719


   



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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434302862



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   Thank you for your question! H but I am not sure I understand if 
correctly. Just to confirm, "The first if condition", are you referring to 
"val.type_code() == kTVMStr" in `CanConvertFrom`? Thank you!





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




[GitHub] [incubator-tvm] ANSHUMAN87 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


ANSHUMAN87 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434299250



##
File path: src/ir/attrs.cc
##
@@ -37,7 +37,7 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& 
args, bool allow_un
 runtime::TVMArgValue val = args[i + 1];
 if (val.IsObjectRef()) {
   dict.Set(key, val.operator ObjectRef());
-} else if (val.type_code() == kTVMStr) {
+} else if (String::CanConvertFrom(val)) {

Review comment:
   @junrushao1994 : Sorry to bug you on this. I was wondering whether, the 
first if condition is always true, when the val is String objref type. Please 
check once. Thanks!





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




[GitHub] [incubator-tvm] dhruvaray commented on pull request #5447: [TOPI,RELAY][TFLITE] Sparse to dense operator

2020-06-02 Thread GitBox


dhruvaray commented on pull request #5447:
URL: https://github.com/apache/incubator-tvm/pull/5447#issuecomment-637941805


   @anijain2305 - Please review 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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434289143



##
File path: include/tvm/runtime/container.h
##
@@ -1301,6 +1301,10 @@ class String : public ObjectRef {
*/
   operator std::string() const { return std::string{get()->data, size()}; }
 
+  static bool CanConvertFrom(const TVMArgValue& val) {

Review comment:
   my bad, 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




[GitHub] [incubator-tvm] tobegit3hub edited a comment on pull request #5714: Rename tvm_dso_op to libtvm_dso_op

2020-06-02 Thread GitBox


tobegit3hub edited a comment on pull request #5714:
URL: https://github.com/apache/incubator-tvm/pull/5714#issuecomment-637920202


   Thanks @zhiics and @tqchen .
   
   We have add the basic user document for TVMDSOOp in 
[discuss](https://discuss.tvm.ai/t/add-the-document-for-tvmdsoop/6622). We have 
integrated with [TensorFlow Serving](https://github.com/tensorflow/serving) for 
serving models with TVM operators as well and we use TVMDSOOp with TVM-based 
operators to get 50% speed-up for TensorFlow depthwise-conv model. It would be 
great if we can contribute some blogs and documents to TVM community.



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




[GitHub] [incubator-tvm] tobegit3hub commented on pull request #5714: Rename tvm_dso_op to libtvm_dso_op

2020-06-02 Thread GitBox


tobegit3hub commented on pull request #5714:
URL: https://github.com/apache/incubator-tvm/pull/5714#issuecomment-637920202


   Thanks @zhiics and @tqchen .
   
   We have add the basic user document for TVMDSOOp in 
[discuss](https://discuss.tvm.ai/t/add-the-document-for-tvmdsoop/6622). We have 
integrated with [TensorFlow Serving](https://github.com/tensorflow/serving) for 
serving models with TVM operators as well and we use TVMDSOOp with TVM-based 
operators to get 50% speed-up for TensorFlow depthwise-conv model. It would be 
great if we can contribute some blogs and documents in official TVM community.



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




[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718#discussion_r434270105



##
File path: include/tvm/runtime/container.h
##
@@ -1301,6 +1301,10 @@ class String : public ObjectRef {
*/
   operator std::string() const { return std::string{get()->data, size()}; }
 
+  static bool CanConvertFrom(const TVMArgValue& val) {

Review comment:
   docstring





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




[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637902225


   Follow-up PR: #5718



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




[GitHub] [incubator-tvm] junrushao1994 opened a new pull request #5718: [Object][FFI] Introduce runtime::String::CanConvertFrom

2020-06-02 Thread GitBox


junrushao1994 opened a new pull request #5718:
URL: https://github.com/apache/incubator-tvm/pull/5718


   which helps to decide if a `TVMArgValue` can be converted to 
`runtime::String`



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




[GitHub] [incubator-tvm] liangfu commented on a change in pull request #5655: Add MicroTVM tutorial using the STM32F746 discovery board

2020-06-02 Thread GitBox


liangfu commented on a change in pull request #5655:
URL: https://github.com/apache/incubator-tvm/pull/5655#discussion_r433008686



##
File path: tutorials/micro/README.txt
##
@@ -0,0 +1,4 @@
+.. _tutorial-micro:
+
+Micro TVM 
+

Review comment:
   alignment to the above





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




[GitHub] [incubator-tvm] tqchen commented on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637861386


   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




[incubator-tvm] branch master updated (062a244 -> 4347b41)

2020-06-02 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 062a244  Rename tvm_dso_op to libtvm_dso_op (#5714)
 add 4347b41  [Object] Unify StrMapNode and MapNode (#5687)

No new revisions were added by this update.

Summary of changes:
 include/tvm/arith/analyzer.h |   2 +-
 include/tvm/arith/int_set.h  |   2 +-
 include/tvm/driver/driver_api.h  |   2 +-
 include/tvm/ir/attrs.h   |   4 +-
 include/tvm/ir/error.h   |   4 +-
 include/tvm/ir/function.h|   2 +-
 include/tvm/ir/module.h  |   4 +-
 include/tvm/ir/transform.h   |   2 +-
 include/tvm/node/container.h | 146 --
 include/tvm/node/node.h  |   4 +-
 include/tvm/node/reflection.h|   3 +-
 include/tvm/relay/dataflow_matcher.h |   3 +-
 include/tvm/relay/expr_functor.h |   2 +-
 include/tvm/relay/pattern_functor.h  |   2 +-
 include/tvm/relay/transform.h|   2 +-
 include/tvm/runtime/container.h  |  53 ++--
 include/tvm/runtime/object.h |   8 +-
 include/tvm/te/operation.h   |  32 +++--
 include/tvm/te/tensor.h  |   4 +-
 include/tvm/tir/analysis.h   |   4 +-
 include/tvm/tir/expr.h   |   2 +-
 include/tvm/tir/stmt.h   |   2 +-
 python/tvm/ir/container.py   |  12 --
 python/tvm/runtime/object.py |   2 +-
 src/arith/const_int_bound.cc |   2 +-
 src/arith/modular_set.cc |   2 +-
 src/arith/rewrite_simplify.h |   2 +-
 src/autotvm/touch_extractor.h|   2 +-
 src/driver/driver_api.cc |   2 +-
 src/ir/attr_functor.h|   2 -
 src/ir/attrs.cc  |   2 +-
 src/ir/error.cc  |   2 +-
 src/ir/expr.cc   |  20 +--
 src/ir/transform.cc  |  10 +-
 src/node/container.cc| 151 +++
 src/node/reflection.cc   |   6 +-
 src/node/serialization.cc|  42 +++
 src/node/structural_equal.cc |   4 +-
 src/node/structural_hash.cc  |   2 +-
 src/printer/meta_data.h  |   7 +-
 src/printer/text_printer.h   |  10 +-
 src/relay/analysis/annotated_region_set.h|  10 +-
 src/relay/analysis/call_graph.h  |   4 +-
 src/relay/analysis/dependency_graph.cc   |   2 +-
 src/relay/analysis/dependency_graph.h|   2 +-
 src/relay/analysis/extract_fused_functions.cc|   2 +-
 src/relay/analysis/feature.cc|   2 +-
 src/relay/analysis/type_solver.h |   2 +-
 src/relay/analysis/util.cc   |   2 +-
 src/relay/analysis/well_formed.cc|   8 +-
 src/relay/backend/build_module.cc|  14 +--
 src/relay/backend/compile_engine.cc  |   6 +-
 src/relay/backend/graph_runtime_codegen.cc   |   2 +-
 src/relay/backend/param_dict.cc  |   2 +-
 src/relay/backend/utils.h|   6 +-
 src/relay/backend/vm/compiler.cc |  14 ++-
 src/relay/backend/vm/compiler.h  |   4 +-
 src/relay/backend/vm/inline_primitives.cc|   2 +-
 src/relay/backend/vm/lambda_lift.cc  |   2 +-
 src/relay/backend/vm/removed_unused_funcs.cc |   2 +-
 src/relay/ir/dataflow_matcher.cc |  45 +++
 src/relay/ir/expr_functor.cc |   2 +-
 src/relay/ir/indexed_graph.h |   2 +-
 src/relay/op/op_common.h |   2 +-
 src/relay/transforms/annotate_target.cc  |   2 +-
 src/relay/transforms/combine_parallel_op.h   |   7 +-
 src/relay/transforms/convert_layout.cc   |   8 +-
 src/relay/transforms/de_duplicate.cc |   4 +-
 src/relay/transforms/dead_code.cc|   4 +-
 src/relay/transforms/eliminate_common_subexpr.cc |   2 +-
 src/relay/transforms/eta_expand.cc   |   2 +-
 src/relay/transforms/expr_subst.cc   |   4 +-
 src/relay/transforms/expr_subst.h|   3 +-
 src/relay/transforms/fold_constant.cc|   2 +-
 src/relay/transforms/gradient.cc |   4 +-
 src/relay/transforms/merge_compiler_regions.cc   |   2 +-
 src/relay/transforms/merge_composite.cc  |   2 +-
 

[GitHub] [incubator-tvm] tqchen merged pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen merged pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687


   



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




[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637860352


   @tqchen CI is green now, can you take another look? Thanks!



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




[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637844354


   @tqchen Sounds good. I will do it in a separate PR then



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




[GitHub] [incubator-tvm] tqchen commented on pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637844108


   See my followup comments on the CanConvertFrom, although we could also bring 
that as a separate PR



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




[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434212540



##
File path: src/runtime/graph/graph_runtime.cc
##
@@ -418,6 +419,9 @@ PackedFunc GraphRuntime::GetFunction(const std::string& 
name,
   int in_idx = 0;
   if (args[0].type_code() == kTVMStr) {
 in_idx = this->GetInputIndex(args[0]);
+  } else if (args[0].IsObjectRef()) {
+auto str = args[0].AsObjectRef();
+in_idx = this->GetInputIndex(str);

Review comment:
   ```CanConvertFrom ``` is a check to check if the TVMArgValue can be 
converted to string





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




[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434212264



##
File path: src/runtime/graph/graph_runtime.cc
##
@@ -418,6 +419,9 @@ PackedFunc GraphRuntime::GetFunction(const std::string& 
name,
   int in_idx = 0;
   if (args[0].type_code() == kTVMStr) {
 in_idx = this->GetInputIndex(args[0]);
+  } else if (args[0].IsObjectRef()) {
+auto str = args[0].AsObjectRef();
+in_idx = this->GetInputIndex(str);

Review comment:
   We already overloaded operator T, just need to check the type. e.g. 
operator String() works fine 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




[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434212264



##
File path: src/runtime/graph/graph_runtime.cc
##
@@ -418,6 +419,9 @@ PackedFunc GraphRuntime::GetFunction(const std::string& 
name,
   int in_idx = 0;
   if (args[0].type_code() == kTVMStr) {
 in_idx = this->GetInputIndex(args[0]);
+  } else if (args[0].IsObjectRef()) {
+auto str = args[0].AsObjectRef();
+in_idx = this->GetInputIndex(str);

Review comment:
   We already overloaded operator T, just need to check the type.





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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434169926



##
File path: src/runtime/graph/graph_runtime.cc
##
@@ -418,6 +419,9 @@ PackedFunc GraphRuntime::GetFunction(const std::string& 
name,
   int in_idx = 0;
   if (args[0].type_code() == kTVMStr) {
 in_idx = this->GetInputIndex(args[0]);
+  } else if (args[0].IsObjectRef()) {
+auto str = args[0].AsObjectRef();
+in_idx = this->GetInputIndex(str);

Review comment:
   Is this saying we overload "operator T" of `TVMArgValue`? Do we put it 
in container.h or packed_func.h?





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




[GitHub] [incubator-tvm] areusch edited a comment on pull request #5655: Add MicroTVM tutorial using the STM32F746 discovery board

2020-06-02 Thread GitBox


areusch edited a comment on pull request #5655:
URL: https://github.com/apache/incubator-tvm/pull/5655#issuecomment-637760600


   Hey Tom, to get this to build further along in the CI, I think you can add 
the following line to docs/conf.py:
   
   '../tutorials/micro'
   
   I added this around line 168 and it kept building



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




[GitHub] [incubator-tvm] areusch commented on pull request #5655: Add MicroTVM tutorial using the STM32F746 discovery board

2020-06-02 Thread GitBox


areusch commented on pull request #5655:
URL: https://github.com/apache/incubator-tvm/pull/5655#issuecomment-637760600


   Hey Tom, to get this to build further along in the CI, I think you can add 
the following line to docs/conf.py:
   
   '../tutorials/micro'
   
   I added this around line 168



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




[GitHub] [incubator-tvm] tqchen commented on pull request #5655: Add MicroTVM tutorial using the STM32F746 discovery board

2020-06-02 Thread GitBox


tqchen commented on pull request #5655:
URL: https://github.com/apache/incubator-tvm/pull/5655#issuecomment-637756370


   @tom-gall please look into the CI failure



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




[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #4312: [TOPI][Relay][OP] Dynamic NMS and strided_slice

2020-06-02 Thread GitBox


kevinthesun commented on a change in pull request #4312:
URL: https://github.com/apache/incubator-tvm/pull/4312#discussion_r434115162



##
File path: python/tvm/relay/frontend/tensorflow.py
##
@@ -614,6 +614,53 @@ def _impl(inputs, attr, params, mod):
 return out
 return _impl
 
+def _nms():
+def _impl(inputs, attr, params, mod):
+# Get parameter values
+max_output_size = 
int(np.atleast_1d(inputs[2].data.asnumpy().astype("int64"))[0])

Review comment:
   Handle symbolic max_output_size:
   ```suggestion
   try:
   max_output_size = 
int(np.atleast_1d(inputs[2].data.asnumpy().astype("int64"))[0])
   except Exception:
   try:
   max_output_size = _infer_value(inputs[2], params, 
mod).asnumpy().astype("int64").tolist()[0]
   except Exception:
   max_output_size = -1
   ```





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




[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #4312: [TOPI][Relay][OP] Dynamic NMS and strided_slice

2020-06-02 Thread GitBox


kevinthesun commented on a change in pull request #4312:
URL: https://github.com/apache/incubator-tvm/pull/4312#discussion_r434115162



##
File path: python/tvm/relay/frontend/tensorflow.py
##
@@ -614,6 +614,53 @@ def _impl(inputs, attr, params, mod):
 return out
 return _impl
 
+def _nms():
+def _impl(inputs, attr, params, mod):
+# Get parameter values
+max_output_size = 
int(np.atleast_1d(inputs[2].data.asnumpy().astype("int64"))[0])

Review comment:
   Handle symbolic max_output_size:
   ```suggestion
   try:
   max_output_size = 
int(np.atleast_1d(inputs[2].data.asnumpy().astype("int64"))[0])
   except Exception:
   try:
   max_output_size = _infer_value(inputs[2], params, 
mod).asnumpy().astype("int64").tolist()[0]
   except Exception:
   max_output_size = inputs[2]
   ```





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




[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #4312: [TOPI][Relay][OP] Dynamic NMS and strided_slice

2020-06-02 Thread GitBox


kevinthesun commented on a change in pull request #4312:
URL: https://github.com/apache/incubator-tvm/pull/4312#discussion_r434111309



##
File path: python/tvm/relay/frontend/tensorflow.py
##
@@ -1119,7 +1166,11 @@ def _impl(inputs, attr, params, mod):
 try:
 begin = _get_list_param(params, inputs[1])
 except (IndexError, KeyError, AttributeError):
-begin = _infer_value(inputs[1], params).asnumpy().tolist()[0]
+# Handle symbolic begin
+try:
+begin = _infer_value(inputs[1], params).asnumpy().tolist()[0]

Review comment:
   ```suggestion
   begin = _infer_value(inputs[1], params).asnumpy().tolist()
   ```





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




[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #4312: [TOPI][Relay][OP] Dynamic NMS and strided_slice

2020-06-02 Thread GitBox


kevinthesun commented on a change in pull request #4312:
URL: https://github.com/apache/incubator-tvm/pull/4312#discussion_r434111490



##
File path: python/tvm/relay/frontend/tensorflow.py
##
@@ -1128,16 +1179,7 @@ def _impl(inputs, attr, params, mod):
 size = _infer_value(inputs[2], params).asnumpy().tolist()[0]

Review comment:
   ```suggestion
   size = _infer_value(inputs[2], params).asnumpy().tolist()
   ```





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




[GitHub] [incubator-tvm] ANSHUMAN87 opened a new pull request #5717: [REFACTOR][IR] Migrate Pass/PassContext ObjectRef to not-null

2020-06-02 Thread GitBox


ANSHUMAN87 opened a new pull request #5717:
URL: https://github.com/apache/incubator-tvm/pull/5717


   Refer #5318
   
   @tqchen, @jroesch  : Please help review, Thanks!



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




[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637740903


   Per our offline discussion, we decided that we use a new name 
ObjectPtrEqual/ObjectPtrHash for previous ObjectEqual/ObjectHash, and the new 
MapObjectHash/MapObjectEqual is renamed as ObjectEqual/ObjectHash.



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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434100950



##
File path: include/tvm/node/container.h
##
@@ -49,11 +50,24 @@ using runtime::ObjectRef;
 using runtime::String;
 using runtime::StringObj;
 
+struct MapObjectHash {

Review comment:
   Per our offline discussion, we decided that we use a new name 
`ObjectPtrEqual`/`ObjectPtrHash` for previous `ObjectEqual`/`ObjectHash`, and 
the new `MapObjectHash`/`MapObjectEqual` is renamed as 
`ObjectEqual`/`ObjectHash`.





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




[GitHub] [incubator-tvm] aGiant commented on pull request #5713: [BUGFIX][CRT] Fix Compilation Error in CRT

2020-06-02 Thread GitBox


aGiant commented on pull request #5713:
URL: https://github.com/apache/incubator-tvm/pull/5713#issuecomment-637735690


   It works, many thanks :)



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




[GitHub] [incubator-tvm] mbrookhart commented on pull request #5619: Add Scatter to Topi/Relay/ONNX via hybrid script

2020-06-02 Thread GitBox


mbrookhart commented on pull request #5619:
URL: https://github.com/apache/incubator-tvm/pull/5619#issuecomment-637732830


   @jwfromm @masahi @Laurawly @Huyuwei I finally found time to get back to this 
and fix the issues with GPU/i386. Could you take a look? Thanks!



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




[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434092626



##
File path: src/runtime/graph/graph_runtime.cc
##
@@ -418,6 +419,9 @@ PackedFunc GraphRuntime::GetFunction(const std::string& 
name,
   int in_idx = 0;
   if (args[0].type_code() == kTVMStr) {
 in_idx = this->GetInputIndex(args[0]);
+  } else if (args[0].IsObjectRef()) {
+auto str = args[0].AsObjectRef();
+in_idx = this->GetInputIndex(str);

Review comment:
   Perhaps we can introduce `static 
runtime::String::CanConvertFrom(TVMArgValue)` and `runtime::String str = 
args[0];`





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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434092224



##
File path: include/tvm/node/container.h
##
@@ -49,11 +50,24 @@ using runtime::ObjectRef;
 using runtime::String;
 using runtime::StringObj;
 
+struct MapObjectHash {

Review comment:
   A workaround can be checking if `type_index_` is `kRuntimeString`





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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434092013



##
File path: include/tvm/node/container.h
##
@@ -49,11 +50,24 @@ using runtime::ObjectRef;
 using runtime::String;
 using runtime::StringObj;
 
+struct MapObjectHash {

Review comment:
   One thing i am not sure of: `ObjectHash` and `ObjectEqual` are defined 
in object.h, do we really want to make it depend on classes defined in 
`container.h`?





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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434090825



##
File path: include/tvm/runtime/container.h
##
@@ -1151,6 +1151,42 @@ class String : public ObjectRef {
*/
   inline String operator=(std::string other);
 
+  /*!
+   * \brief Compare is less than other std::string
+   *
+   * \param other The other string
+   *
+   * \return the comparison result
+   */
+  bool operator<(const std::string& other) const { return this->compare(other) 
< 0; }
+
+  /*!
+   * \brief Compare is greater than other std::string
+   *
+   * \param other The other string
+   *
+   * \return the comparison result
+   */
+  bool operator>(const std::string& other) const { return this->compare(other) 
> 0; }

Review comment:
   sure!





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




[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


tqchen commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434089882



##
File path: include/tvm/runtime/container.h
##
@@ -1151,6 +1151,42 @@ class String : public ObjectRef {
*/
   inline String operator=(std::string other);
 
+  /*!
+   * \brief Compare is less than other std::string
+   *
+   * \param other The other string
+   *
+   * \return the comparison result
+   */
+  bool operator<(const std::string& other) const { return this->compare(other) 
< 0; }
+
+  /*!
+   * \brief Compare is greater than other std::string
+   *
+   * \param other The other string
+   *
+   * \return the comparison result
+   */
+  bool operator>(const std::string& other) const { return this->compare(other) 
> 0; }

Review comment:
   let us add regression testcases!

##
File path: include/tvm/node/container.h
##
@@ -49,11 +50,24 @@ using runtime::ObjectRef;
 using runtime::String;
 using runtime::StringObj;
 
+struct MapObjectHash {
+  size_t operator()(const ObjectRef& a) const {
+return a->IsInstance() ? 
std::hash()(Downcast(a)) : ObjectHash()(a);
+  }
+};
+
+struct MapObjectEqual {
+  bool operator()(const ObjectRef& a, const ObjectRef& b) const {
+return a.same_as(b) || (a->IsInstance() && 
b->IsInstance() &&

Review comment:
   we might want to optimize the case a bit for string, because downcast 
and IsInstance are duplicated.

##
File path: include/tvm/node/container.h
##
@@ -49,11 +50,24 @@ using runtime::ObjectRef;
 using runtime::String;
 using runtime::StringObj;
 
+struct MapObjectHash {

Review comment:
   can we simply change ObjectHash to this impl?





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




[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #5619: Add Scatter to Topi/Relay/ONNX via hybrid script

2020-06-02 Thread GitBox


kevinthesun commented on a change in pull request #5619:
URL: https://github.com/apache/incubator-tvm/pull/5619#discussion_r434057734



##
File path: python/tvm/relay/op/_transform.py
##
@@ -383,6 +391,13 @@ def argwhere_shape_func(attrs, inputs, out_ndims):
 return [_argwhere_shape_func_5d(inputs[0])]
 return ValueError("Does not support rank higher than 5 in argwhere")
 
+@_reg.register_shape_func("scatter", True)

Review comment:
   Directly use elemwise shape func: ```register_shape_func("scatter", 
False, elemwise_shape_func)```





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




[GitHub] [incubator-tvm] notoraptor commented on a change in pull request #5716: [topi][relay] Add operation gather to relay.

2020-06-02 Thread GitBox


notoraptor commented on a change in pull request #5716:
URL: https://github.com/apache/incubator-tvm/pull/5716#discussion_r434051229



##
File path: topi/include/topi/transform.h
##
@@ -982,6 +982,54 @@ inline Tensor tile(const Tensor& x, Array reps, 
std::string name = "T_t
   }
 }
 
+/*!
+ * \brief Gather values along given axis from given indices.
+ *
+ * \param data The input data to the operator.
+ * \param axis The axis along which to index.
+ * \param indices The indices of values to gather.
+ * \param name The name of the operation.
+ * \param tag The tag to mark the operation.
+ *
+ * \return A Tensor whose op member is the gather_nd operation

Review comment:
   Fixed

##
File path: topi/python/topi/testing/gather_python.py
##
@@ -0,0 +1,46 @@
+# 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, line-too-long, unused-variable, too-many-locals
+"""gather_nd in python"""

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




[GitHub] [incubator-tvm] abergeron commented on a change in pull request #5716: [topi][relay] Add operation gather to relay.

2020-06-02 Thread GitBox


abergeron commented on a change in pull request #5716:
URL: https://github.com/apache/incubator-tvm/pull/5716#discussion_r434044772



##
File path: topi/include/topi/transform.h
##
@@ -982,6 +982,54 @@ inline Tensor tile(const Tensor& x, Array reps, 
std::string name = "T_t
   }
 }
 
+/*!
+ * \brief Gather values along given axis from given indices.
+ *
+ * \param data The input data to the operator.
+ * \param axis The axis along which to index.
+ * \param indices The indices of values to gather.
+ * \param name The name of the operation.
+ * \param tag The tag to mark the operation.
+ *
+ * \return A Tensor whose op member is the gather_nd operation

Review comment:
   You probably mean
   ```suggestion
* \return A Tensor whose op member is the gather operation
   ```

##
File path: topi/python/topi/testing/gather_python.py
##
@@ -0,0 +1,46 @@
+# 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, line-too-long, unused-variable, too-many-locals
+"""gather_nd in python"""

Review comment:
   ```suggestion
   """gather in python"""
   ```





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




[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#issuecomment-637690190


   CC @tqchen @jwfromm: this PR is ready for review! Please take a look if you 
are interested.



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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434039911



##
File path: src/runtime/graph/graph_runtime.cc
##
@@ -418,6 +419,9 @@ PackedFunc GraphRuntime::GetFunction(const std::string& 
name,
   int in_idx = 0;
   if (args[0].type_code() == kTVMStr) {
 in_idx = this->GetInputIndex(args[0]);
+  } else if (args[0].IsObjectRef()) {
+auto str = args[0].AsObjectRef();
+in_idx = this->GetInputIndex(str);

Review comment:
   This is kind of verbose that we have to check kTVMStr and Object 
runtime::String...Is there any better solution?





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




[GitHub] [incubator-tvm] notoraptor opened a new pull request #5716: [topi][relay] Add operation gather to relay.

2020-06-02 Thread GitBox


notoraptor opened a new pull request #5716:
URL: https://github.com/apache/incubator-tvm/pull/5716


   Hi! This is a PR to add operation `gather` to relay, the same operation as 
in torch: https://pytorch.org/docs/stable/torch.html#torch.gather



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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434037129



##
File path: include/tvm/runtime/container.h
##
@@ -1151,6 +1151,42 @@ class String : public ObjectRef {
*/
   inline String operator=(std::string other);
 
+  /*!
+   * \brief Compare is less than other std::string
+   *
+   * \param other The other string
+   *
+   * \return the comparison result
+   */
+  bool operator<(const std::string& other) const { return this->compare(other) 
< 0; }

Review comment:
   This was a missing part that can potentially cause mysterious bugs, 
because < was inherited from ObjectRef which was pointer comparison instead.





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




[GitHub] [incubator-tvm] junrushao1994 commented on a change in pull request #5687: [Draft][Object] Unify StrMapNode and MapNode

2020-06-02 Thread GitBox


junrushao1994 commented on a change in pull request #5687:
URL: https://github.com/apache/incubator-tvm/pull/5687#discussion_r434035004



##
File path: include/tvm/node/container.h
##
@@ -49,11 +50,24 @@ using runtime::ObjectRef;
 using runtime::String;
 using runtime::StringObj;
 
+struct MapObjectHash {

Review comment:
   This change converts compile time dispatch to runtime dispatch





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




[incubator-tvm] branch master updated (3d06063 -> 062a244)

2020-06-02 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 3d06063  [BUGFIX][CRT] Fix Compilation Error in CRT (#5713)
 add 062a244  Rename tvm_dso_op to libtvm_dso_op (#5714)

No new revisions were added by this update.

Summary of changes:
 cmake/modules/contrib/TF_TVMDSOOP.cmake | 1 -
 python/tvm/contrib/tf_op/module.py  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)



[GitHub] [incubator-tvm] tqchen commented on issue #5709: tvm/apps/bundle_deploy/build --> make failed

2020-06-02 Thread GitBox


tqchen commented on issue #5709:
URL: https://github.com/apache/incubator-tvm/issues/5709#issuecomment-637661955


   #5713



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




[incubator-tvm] branch master updated: [BUGFIX][CRT] Fix Compilation Error in CRT (#5713)

2020-06-02 Thread tqchen
This is an automated email from the ASF dual-hosted git repository.

tqchen 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 3d06063  [BUGFIX][CRT] Fix Compilation Error in CRT (#5713)
3d06063 is described below

commit 3d0606313f2cb7625eeec5308fe33354dc94fc90
Author: Liangfu Chen 
AuthorDate: Wed Jun 3 00:22:14 2020 +0800

[BUGFIX][CRT] Fix Compilation Error in CRT (#5713)
---
 src/runtime/crt/crt_backend_api.c | 2 ++
 src/runtime/crt/ndarray.c | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/runtime/crt/crt_backend_api.c 
b/src/runtime/crt/crt_backend_api.c
index fe71439..7589ce4 100644
--- a/src/runtime/crt/crt_backend_api.c
+++ b/src/runtime/crt/crt_backend_api.c
@@ -24,6 +24,8 @@
 #include 
 #include 
 
+#include "packed_func.h"
+
 void* TVMBackendAllocWorkspace(int device_type, int device_id, uint64_t 
nbytes, int dtype_code_hint,
int dtype_bits_hint) {
   void* ptr = 0;
diff --git a/src/runtime/crt/ndarray.c b/src/runtime/crt/ndarray.c
index 02c37bf..17e2107 100644
--- a/src/runtime/crt/ndarray.c
+++ b/src/runtime/crt/ndarray.c
@@ -100,9 +100,9 @@ int TVMNDArray_Load(TVMNDArray* ret, const char** strm) {
   *strm += sizeof(data_byte_size);
   if (!(data_byte_size == num_elems * elem_bytes)) {
 fprintf(stderr,
-"invalid DLTensor file format: data_byte_size=%jd, "
-"while num_elems*elem_bytes=%jd\n",
-data_byte_size, (num_elems * elem_bytes));
+"invalid DLTensor file format: data_byte_size=%d, "
+"while num_elems*elem_bytes=%d\n",
+(int)data_byte_size, (int)(num_elems * elem_bytes));  // NOLINT(*)
 status = -1;
   }
   memcpy(ret->dl_tensor.data, *strm, data_byte_size);



[GitHub] [incubator-tvm] tqchen merged pull request #5714: Rename tvm_dso_op to libtvm_dso_op

2020-06-02 Thread GitBox


tqchen merged pull request #5714:
URL: https://github.com/apache/incubator-tvm/pull/5714


   



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




[GitHub] [incubator-tvm] tqchen closed issue #5709: tvm/apps/bundle_deploy/build --> make failed

2020-06-02 Thread GitBox


tqchen closed issue #5709:
URL: https://github.com/apache/incubator-tvm/issues/5709


   



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




[GitHub] [incubator-tvm] tqchen merged pull request #5713: [BUGFIX][CRT] Fix Compilation Error in CRT

2020-06-02 Thread GitBox


tqchen merged pull request #5713:
URL: https://github.com/apache/incubator-tvm/pull/5713


   



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




[GitHub] [incubator-tvm] mbrookhart commented on issue #5667: [TEST][FLAKY] tests/python/contrib/test_cudnn.py

2020-06-02 Thread GitBox


mbrookhart commented on issue #5667:
URL: https://github.com/apache/incubator-tvm/issues/5667#issuecomment-637656260


   I can reproduce this consistently on my desktop system with Cuda 10.0 and 
Cudnn 7.6.5.



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




[GitHub] [incubator-tvm] siju-samuel opened a new pull request #5715: [MXNET]Softmin, trunc op support added

2020-06-02 Thread GitBox


siju-samuel opened a new pull request #5715:
URL: https://github.com/apache/incubator-tvm/pull/5715


   - softmin
   - trunc 
   ops support added to Mxnet frontend
   
   @masahi @FrozenGene please help to review 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




[GitHub] [incubator-tvm] tobegit3hub opened a new pull request #5714: Rename tvm_dso_op to libtvm_dso_op

2020-06-02 Thread GitBox


tobegit3hub opened a new pull request #5714:
URL: https://github.com/apache/incubator-tvm/pull/5714


   Rename the library of TVMDSOOp to `libtvm_dso_op.so` instead of 
`tvm_dso_op.so`. It is a quick fix to follow the convention of library name and 
is useful to integrate with `TensorFlow Serving` with the new library name.



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