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/09/05 06:38:00 UTC

[GitHub] [tvm] echuraev commented on a diff in pull request #12490: [OpenCL] Enable OpenCL for GPU tasks

echuraev commented on code in PR #12490:
URL: https://github.com/apache/tvm/pull/12490#discussion_r962521169


##########
tests/python/relay/opencl_texture/test_conv2d_nchw_texture.py:
##########
@@ -437,7 +422,7 @@ def test_conv2d_vgg16_winograd_4d():
     stat_file = temp.relpath("stat.log")
     with open(stat_file, "w") as f:
         f.write(
-            '{"input": ["opencl -keys=adreno,opencl,gpu -device=adreno -max_num_threads=256", "conv2d_nchw_winograd_acc32.image2d", [["TENSOR", [1, 512, 28, 28], "float16"], ["TENSOR", [512, 512, 3, 3], "float16"], [1, 1], [1, 1, 1, 1], [1, 1], "float16"], {}], "config": {"index": 1591, "code_hash": null, "entity": [["auto_unroll_max_step", "ot", 4], ["tile_y", "sp", [-1, 1, 32]], ["tile_x", "sp", [-1, 4, 2]], ["tile_rc", "sp", [-1, 8]]]}, "result": [[0.0037244], 0, 7.06374192237854, 1653898629.7427933], "version": 0.2, "tvm_version": "0.8.dev0"}\n'
+            '{"input": ["opencl -keys=adreno,opencl,gpu -device=adreno -max_num_threads=256", "conv2d_nchw_winograd_acc32.image2d", [["TENSOR", [1, 512, 28, 28], "float32"], ["TENSOR", [512, 512, 3, 3], "float32"], [1, 1], [1, 1, 1, 1], [1, 1], "float32"], {}], "config": {"index": 1591, "code_hash": null, "entity": [["auto_unroll_max_step", "ot", 4], ["tile_y", "sp", [-1, 1, 32]], ["tile_x", "sp", [-1, 4, 2]], ["tile_rc", "sp", [-1, 8]]]}, "result": [[0.0037244], 0, 7.06374192237854, 1653898629.7427933], "version": 0.2, "tvm_version": "0.8.dev0"}\n'

Review Comment:
   You can use here value of variable `dtype` and the same below.



##########
tests/cpp-runtime/opencl/run_gtests.cc:
##########
@@ -40,7 +40,7 @@ TVM_REGISTER_GLOBAL("opencl.run_gtests").set_body([](TVMArgs args, TVMRetValue*
   argv.push_back(const_cast<char*>("opencl_run_gtests"));
 
   // add parsed arguments
-  for (int i = 0; i < parsed_args.size(); ++i) {
+  for (uint i = 0; i < parsed_args.size(); ++i) {

Review Comment:
   `size_t` should be better than `uint`.



##########
tests/python/relay/opencl_texture/test_conv2d_nhwc_texture.py:
##########
@@ -313,10 +303,9 @@ def test_conv2d_inceptionv3_35_35_strides():
 
 
 @tvm.testing.requires_opencl
-def test_conv2d_resnet50_v2_nhwc_3c():
-    target = "opencl --device=adreno"
-    dtype = "float16"
-
+@tvm.testing.parametrize_targets("opencl -device=adreno")
+@pytest.mark.xfail(raises=tvm._ffi.base.TVMError)

Review Comment:
   Why some of the tests are marked as xfail? I thought that all of them should be passed.



##########
tests/python/contrib/test_opencl/test_run_gtests.py:
##########
@@ -28,6 +29,7 @@
 # for example to run all "foo" tests twice and observe gtest output run
 # pytest -sv <this file> --gtests_args="--gtest_filter=*foo* --gtest_repeat=2"
 @tvm.testing.requires_opencl
+@pytest.mark.xfail(raises=AttributeError)

Review Comment:
   Why do we need to mark this test as xfail?



##########
CMakeLists.txt:
##########
@@ -798,4 +798,4 @@ if(${SUMMARIZE})
   print_summary()
 endif()
 
-dump_options_to_file("${TVM_ALL_OPTIONS}")
+dump_options_to_file("${TVM_ALL_OPTIONS}")

Review Comment:
   No meaningful changes. Please revert it.



##########
tests/python/relay/opencl_texture/test_conv2d_nhwc_texture.py:
##########
@@ -598,7 +576,7 @@ def test_conv2d_vgg16_winograd_4d():
     stat_file = temp.relpath("stat.log")
     with open(stat_file, "w") as f:
         f.write(
-            '{"input": ["opencl -keys=adreno,opencl,gpu -device=adreno -max_num_threads=256", "conv2d_nhwc_winograd_acc32.image2d", [["TENSOR", [1, 28, 28, 512], "float16"], ["TENSOR", [3, 3, 512, 512], "float16"], [1, 1], [1, 1, 1, 1], [1, 1], "float16"], {}], "config": {"index": 1591, "code_hash": null, "entity": [["auto_unroll_max_step", "ot", 4], ["tile_y", "sp", [-1, 1, 32]], ["tile_x", "sp", [-1, 4, 2]], ["tile_rc", "sp", [-1, 8]]]}, "result": [[0.0037244], 0, 7.06374192237854, 1653898629.7427933], "version": 0.2, "tvm_version": "0.8.dev0"}\n'
+            '{"input": ["opencl -keys=adreno,opencl,gpu -device=adreno -max_num_threads=256", "conv2d_nhwc_winograd_acc32.image2d", [["TENSOR", [1, 28, 28, 512], "float32"], ["TENSOR", [3, 3, 512, 512], "float32"], [1, 1], [1, 1, 1, 1], [1, 1], "float32"], {}], "config": {"index": 1591, "code_hash": null, "entity": [["auto_unroll_max_step", "ot", 4], ["tile_y", "sp", [-1, 1, 32]], ["tile_x", "sp", [-1, 4, 2]], ["tile_rc", "sp", [-1, 8]]]}, "result": [[0.0037244], 0, 7.06374192237854, 1653898629.7427933], "version": 0.2, "tvm_version": "0.8.dev0"}\n'

Review Comment:
   Use `dtype`



##########
tests/python/relay/opencl_texture/utils/adreno_utils.py:
##########
@@ -71,7 +71,6 @@ def build_run_compare(
         tvm_mod_nchwc = gpu_preprocess(tvm_mod)
     else:
         tvm_mod_nchwc = tvm_mod

Review Comment:
   Please, revert this change



##########
tests/python/relay/opencl_texture/test_conv2d_nchw_texture.py:
##########
@@ -496,7 +479,9 @@ def test_conv2d_winograd_conv():
 
 
 @tvm.testing.requires_opencl
-def test_residual_block():
+@tvm.testing.parametrize_targets("opencl -device=adreno")
+@pytest.mark.xfail

Review Comment:
   Why this test marked as `xfail`? 
   cc: @elvin-n 



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