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 2021/11/11 15:21:51 UTC

[GitHub] [tvm] tqchen opened a new pull request #9497: [TARGET] Move target_host usage to new target style.

tqchen opened a new pull request #9497:
URL: https://github.com/apache/tvm/pull/9497


   - Add deprecation warnings to functions with target_host parameters.
   - Update the build usage to new target style.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on pull request #9497: [TARGET] Move target_host usage to new target style.

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


   CC: @zxybazh 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] tqchen edited a comment on pull request #9497: [TARGET] Move target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
tqchen edited a comment on pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#issuecomment-966550013


   These were the left over items that should have been done as part of the Target system refactor. Most of the tutorials already moved to the new styles in previous refactor by @zxybazh , this PR aims to cleanup the rest.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zxybazh commented on a change in pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
zxybazh commented on a change in pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#discussion_r748084042



##########
File path: python/tvm/autotvm/task/relay_integration.py
##########
@@ -77,6 +78,11 @@ def extract_from_program(mod, params, target, target_host=None, ops=None):
     task: Array of autotvm.task.Task
         collected tasks
     """
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )

Review comment:
       Shall we also add the warning to `extract_from_multiple_program`?

##########
File path: python/tvm/relay/build_module.py
##########
@@ -332,16 +337,23 @@ def build(ir_mod, target=None, target_host=None, params=None, mod_name="default"
             "instead of deprecated parameter mod (tvm.relay.function.Function)",
             DeprecationWarning,
         )
+
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )
+
+    target, target_host = Target.check_and_update_host_consist(
+        target, target_host, target_is_dict_key=False
+    )
+
     target = build_target_by_device_type_map(target)
     if isinstance(target_host, (str, Target)):
         target_host = Target(target_host)
     elif target_host:
         raise ValueError("target host must be the type of str, " + "tvm.target.Target, or None")

Review comment:
       This part seems to be obsolete after the change.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zxybazh commented on pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
zxybazh commented on pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#issuecomment-967433271


   Sounds good. I'll send a follow up 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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Hzfengsy merged pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
Hzfengsy merged pull request #9497:
URL: https://github.com/apache/tvm/pull/9497


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius commented on pull request #9497: [TARGET] Move target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
Mousius commented on pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#issuecomment-966488004


   Hi @tqchen,
   
   Is there an RFC or tracking issue for this you can link to this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zxybazh commented on a change in pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
zxybazh commented on a change in pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#discussion_r748551678



##########
File path: python/tvm/relay/build_module.py
##########
@@ -332,16 +337,23 @@ def build(ir_mod, target=None, target_host=None, params=None, mod_name="default"
             "instead of deprecated parameter mod (tvm.relay.function.Function)",
             DeprecationWarning,
         )
+
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )
+
+    target, target_host = Target.check_and_update_host_consist(
+        target, target_host, target_is_dict_key=False
+    )
+
     target = build_target_by_device_type_map(target)
     if isinstance(target_host, (str, Target)):
         target_host = Target(target_host)
     elif target_host:
         raise ValueError("target host must be the type of str, " + "tvm.target.Target, or None")

Review comment:
       The type is already checked when doing `check_and_update_host_consist`, see [here](https://github.com/apache/tvm/blob/be03d62e5b0afd607964365bc73e94f72fdfaaef/python/tvm/target/target.py#L108). I'll remove it and check if there are other obsolete parts in my follow up 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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] tqchen commented on a change in pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

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



##########
File path: python/tvm/relay/build_module.py
##########
@@ -332,16 +337,23 @@ def build(ir_mod, target=None, target_host=None, params=None, mod_name="default"
             "instead of deprecated parameter mod (tvm.relay.function.Function)",
             DeprecationWarning,
         )
+
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )
+
+    target, target_host = Target.check_and_update_host_consist(
+        target, target_host, target_is_dict_key=False
+    )
+
     target = build_target_by_device_type_map(target)
     if isinstance(target_host, (str, Target)):
         target_host = Target(target_host)
     elif target_host:
         raise ValueError("target host must be the type of str, " + "tvm.target.Target, or None")

Review comment:
       since we only issue an warning, we might still want to keep this one




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] tqchen commented on pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

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


   Thanks @zxybazh , given `check_and_update_host_consist` can be called multiple times, it may not be desirable to do so(for the second time it is called). So I think we can still take the explicit approach. The suggestion of `extract_from_multiple_program` is great, can you send a followup 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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zxybazh commented on a change in pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
zxybazh commented on a change in pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#discussion_r748551678



##########
File path: python/tvm/relay/build_module.py
##########
@@ -332,16 +337,23 @@ def build(ir_mod, target=None, target_host=None, params=None, mod_name="default"
             "instead of deprecated parameter mod (tvm.relay.function.Function)",
             DeprecationWarning,
         )
+
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )
+
+    target, target_host = Target.check_and_update_host_consist(
+        target, target_host, target_is_dict_key=False
+    )
+
     target = build_target_by_device_type_map(target)
     if isinstance(target_host, (str, Target)):
         target_host = Target(target_host)
     elif target_host:
         raise ValueError("target host must be the type of str, " + "tvm.target.Target, or None")

Review comment:
       The type is already checked when doing `check_and_update_host_consist` when it calls `target = Target(target, host)`, see [here](https://github.com/apache/tvm/blob/be03d62e5b0afd607964365bc73e94f72fdfaaef/python/tvm/target/target.py#L108). I'll remove it and check if there are other obsolete parts in my follow up 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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] zxybazh commented on a change in pull request #9497: [TARGET] Cleanup the target_host usage to new target style.

Posted by GitBox <gi...@apache.org>.
zxybazh commented on a change in pull request #9497:
URL: https://github.com/apache/tvm/pull/9497#discussion_r748092385



##########
File path: python/tvm/relay/build_module.py
##########
@@ -332,16 +337,23 @@ def build(ir_mod, target=None, target_host=None, params=None, mod_name="default"
             "instead of deprecated parameter mod (tvm.relay.function.Function)",
             DeprecationWarning,
         )
+
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )
+
+    target, target_host = Target.check_and_update_host_consist(
+        target, target_host, target_is_dict_key=False
+    )
+
     target = build_target_by_device_type_map(target)
     if isinstance(target_host, (str, Target)):
         target_host = Target(target_host)
     elif target_host:
         raise ValueError("target host must be the type of str, " + "tvm.target.Target, or None")

Review comment:
       This part seems to be obsolete after the change, would be great to remove.

##########
File path: python/tvm/autotvm/task/relay_integration.py
##########
@@ -77,6 +78,11 @@ def extract_from_program(mod, params, target, target_host=None, ops=None):
     task: Array of autotvm.task.Task
         collected tasks
     """
+    if target_host is not None:
+        warnings.warn(
+            "target_host parameter is going to be deprecated. "
+            "Please pass in tvm.target.Target(target, host=target_host) instead."
+        )

Review comment:
       Shall we also add the warning to `extract_from_multiple_program` as well?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] tqchen commented on pull request #9497: [TARGET] Move target_host usage to new target style.

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


   These were the left over items that should have been done as part of the Target system refactor.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on pull request #9497: [TARGET] Move target_host usage to new target style.

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


   @Mousius The RFC is here: https://discuss.tvm.apache.org/t/rfc-tvm-target-specification/6844


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org