You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/11/02 20:28:01 UTC

[GitHub] [tvm] mehrdadh opened a new pull request, #13271: [Hexagon] Lint tests part 2

mehrdadh opened a new pull request, #13271:
URL: https://github.com/apache/tvm/pull/13271

   This PR adds more pylint to hexagon tests.


-- 
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] mehrdadh commented on pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on PR #13271:
URL: https://github.com/apache/tvm/pull/13271#issuecomment-1303943551

   @masahi please take a look.


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

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

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


[GitHub] [tvm] masahi merged pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
masahi merged PR #13271:
URL: https://github.com/apache/tvm/pull/13271


-- 
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] mehrdadh commented on a diff in pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on code in PR #13271:
URL: https://github.com/apache/tvm/pull/13271#discussion_r1014478593


##########
tests/python/contrib/test_hexagon/metaschedule_e2e/export_models.py:
##########
@@ -34,14 +37,16 @@ def export_resnet50_fp16():
     mod, params = relay.frontend.from_pytorch(script_module, input_shapes)
     mod = relay.transform.ToMixedPrecision("float16")(mod)
 
-    with open("resnet50_fp16.json", "w") as fo:
-        fo.write(tvm.ir.save_json(mod))
+    with open("resnet50_fp16.json", "w") as file:
+        file.write(tvm.ir.save_json(mod))
 
-    with open("resnet50_fp16.params", "wb") as fo:
-        fo.write(relay.save_param_dict(params))
+    with open("resnet50_fp16.params", "wb") as file:
+        file.write(relay.save_param_dict(params))

Review Comment:
   If it is bothering let's disable it at the TVM level. Otherwise we're gonna have bunch of `pylint_disable` tags which kind of defeats the purpose of pylint.



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

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

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


[GitHub] [tvm] masahi commented on a diff in pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13271:
URL: https://github.com/apache/tvm/pull/13271#discussion_r1014451134


##########
tests/python/contrib/test_hexagon/metaschedule_e2e/export_models.py:
##########
@@ -34,14 +37,16 @@ def export_resnet50_fp16():
     mod, params = relay.frontend.from_pytorch(script_module, input_shapes)
     mod = relay.transform.ToMixedPrecision("float16")(mod)
 
-    with open("resnet50_fp16.json", "w") as fo:
-        fo.write(tvm.ir.save_json(mod))
+    with open("resnet50_fp16.json", "w") as file:
+        file.write(tvm.ir.save_json(mod))
 
-    with open("resnet50_fp16.params", "wb") as fo:
-        fo.write(relay.save_param_dict(params))
+    with open("resnet50_fp16.params", "wb") as file:
+        file.write(relay.save_param_dict(params))

Review Comment:
   I think it is ok to add `# pylint: disable=invalid-name` to avoid these changes. We use that everywhere. 



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

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

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


[GitHub] [tvm] masahi commented on a diff in pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13271:
URL: https://github.com/apache/tvm/pull/13271#discussion_r1014450161


##########
tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_fp16.py:
##########
@@ -44,14 +40,19 @@ def convert_conv2d_layout(mod, desired_layouts):
 @pytest.mark.skip("End-to-end tuning is skipped on CI.")
 @tvm.testing.requires_hexagon
 def test_resnet50(hexagon_launcher):
+    """Test Resnet50."""
+    model_json = "resnet50_fp16.json"
+    target_llvm = tvm.target.Target("llvm")
+    target_hexagon = get_hexagon_target("v69")
+
     if not os.path.exists(model_json):
         pytest.skip(msg="Run python export_models.py first.")
 
-    with open(model_json, "r") as fi:
-        mod = tvm.ir.load_json(fi.read())
+    with open(model_json, "r") as file:
+        mod = tvm.ir.load_json(file.read())
 
-    with open(model_params, "rb") as fi:
-        params = relay.load_param_dict(fi.read())
+    with open("resnet50_fp16.params", "rb") as file:

Review Comment:
   Can you restore the `model_params` variable rather than hard-coding it? The same comment for `test_resnet50_int8.py`.



-- 
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] mehrdadh commented on a diff in pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on code in PR #13271:
URL: https://github.com/apache/tvm/pull/13271#discussion_r1014471259


##########
tests/python/contrib/test_hexagon/metaschedule_e2e/export_models.py:
##########
@@ -34,14 +37,16 @@ def export_resnet50_fp16():
     mod, params = relay.frontend.from_pytorch(script_module, input_shapes)
     mod = relay.transform.ToMixedPrecision("float16")(mod)
 
-    with open("resnet50_fp16.json", "w") as fo:
-        fo.write(tvm.ir.save_json(mod))
+    with open("resnet50_fp16.json", "w") as file:
+        file.write(tvm.ir.save_json(mod))
 
-    with open("resnet50_fp16.params", "wb") as fo:
-        fo.write(relay.save_param_dict(params))
+    with open("resnet50_fp16.params", "wb") as file:
+        file.write(relay.save_param_dict(params))

Review Comment:
   I reversed them back to global variables, but made them capital.



##########
tests/python/contrib/test_hexagon/metaschedule_e2e/test_resnet50_fp16.py:
##########
@@ -44,14 +40,19 @@ def convert_conv2d_layout(mod, desired_layouts):
 @pytest.mark.skip("End-to-end tuning is skipped on CI.")
 @tvm.testing.requires_hexagon
 def test_resnet50(hexagon_launcher):
+    """Test Resnet50."""
+    model_json = "resnet50_fp16.json"
+    target_llvm = tvm.target.Target("llvm")
+    target_hexagon = get_hexagon_target("v69")
+
     if not os.path.exists(model_json):
         pytest.skip(msg="Run python export_models.py first.")
 
-    with open(model_json, "r") as fi:
-        mod = tvm.ir.load_json(fi.read())
+    with open(model_json, "r") as file:
+        mod = tvm.ir.load_json(file.read())
 
-    with open(model_params, "rb") as fi:
-        params = relay.load_param_dict(fi.read())
+    with open("resnet50_fp16.params", "rb") as file:

Review Comment:
   fixed 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] tvm-bot commented on pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13271:
URL: https://github.com/apache/tvm/pull/13271#issuecomment-1301188855

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * No users to tag found in teams: `hexagon` <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


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

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

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


[GitHub] [tvm] masahi commented on a diff in pull request #13271: [Hexagon] Lint tests part 2

Posted by GitBox <gi...@apache.org>.
masahi commented on code in PR #13271:
URL: https://github.com/apache/tvm/pull/13271#discussion_r1014474628


##########
tests/python/contrib/test_hexagon/metaschedule_e2e/export_models.py:
##########
@@ -34,14 +37,16 @@ def export_resnet50_fp16():
     mod, params = relay.frontend.from_pytorch(script_module, input_shapes)
     mod = relay.transform.ToMixedPrecision("float16")(mod)
 
-    with open("resnet50_fp16.json", "w") as fo:
-        fo.write(tvm.ir.save_json(mod))
+    with open("resnet50_fp16.json", "w") as file:
+        file.write(tvm.ir.save_json(mod))
 
-    with open("resnet50_fp16.params", "wb") as fo:
-        fo.write(relay.save_param_dict(params))
+    with open("resnet50_fp16.params", "wb") as file:
+        file.write(relay.save_param_dict(params))

Review Comment:
   I meant the change from `fo` to `file`.  I'm generally not happy with `black` complaining about short names like that.



-- 
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