You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/04 07:10:14 UTC

[GitHub] [incubator-tvm] junrushao1994 opened a new pull request #5993: [Target] Use TargetNode::attrs for Target serialization

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


   This PR contains several minor but breaking changes as mentioned in #5960.
   
   1. Use `TargetNode::attrs` for serialization, which means that the raw string exported from target object may largely differ from the raw string input to create target object.
   2. Change type of `-mattr` to `Array<String>` from `String`.
   3. Remove `keys` from `attrs` after parsing, in order to avoid potential duplication and confusion.
   4. De-duplicate `keys` after parsing.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] tqchen merged pull request #5993: [Target] Use TargetNode::attrs for Target serialization

Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #5993:
URL: https://github.com/apache/incubator-tvm/pull/5993


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5993: [Target] Use TargetNode::attrs for Target serialization

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #5993:
URL: https://github.com/apache/incubator-tvm/pull/5993#discussion_r449897101



##########
File path: include/tvm/target/target_id.h
##########
@@ -60,30 +60,35 @@ class TargetIdNode : public Object {
   int device_type;
   /*! \brief Default keys of the target */
   Array<String> default_keys;
-  /*! \brief Stores the required type_key and type_index of a specific attr of a target */
-  struct ValueTypeInfo {
-    String type_key;
-    uint32_t type_index;
-    std::unique_ptr<ValueTypeInfo> key;
-    std::unique_ptr<ValueTypeInfo> val;
-  };
 
   void VisitAttrs(AttrVisitor* v) {
     v->Visit("name", &name);
     v->Visit("device_type", &device_type);
     v->Visit("default_keys", &default_keys);
   }
 
-  Map<String, ObjectRef> ParseAttrsFromRawString(const std::vector<std::string>& options);
+  Map<String, ObjectRef> ParseAttrsFromRaw(const std::vector<std::string>& options) const;
+
+  Optional<String> StringifyAttrsToRaw(const Map<String, ObjectRef>& attrs) const;
 
   static constexpr const char* _type_key = "TargetId";
   TVM_DECLARE_FINAL_OBJECT_INFO(TargetIdNode, Object);
 
  private:
+  /*! \brief Stores the required type_key and type_index of a specific attr of a target */
+  struct ValueTypeInfo {
+    String type_key;
+    uint32_t type_index;
+    std::unique_ptr<ValueTypeInfo> key;
+    std::unique_ptr<ValueTypeInfo> val;

Review comment:
       val-> value




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tvm] tqchen commented on pull request #5993: [Target] Use TargetNode::attrs for Target serialization

Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #5993:
URL: https://github.com/apache/incubator-tvm/pull/5993#issuecomment-653911619


   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:
users@infra.apache.org



[GitHub] [incubator-tvm] junrushao1994 commented on pull request #5993: [Target] Use TargetNode::attrs for Target serialization

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #5993:
URL: https://github.com/apache/incubator-tvm/pull/5993#issuecomment-653775632


   CC: @tqchen @icemelon9 


----------------------------------------------------------------
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:
users@infra.apache.org