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 2019/11/14 18:18:57 UTC

[GitHub] [incubator-tvm] comaniac commented on a change in pull request #4338: AutoTVM: selecting tuning templates when extracting task

comaniac commented on a change in pull request #4338: AutoTVM: selecting tuning templates when extracting task
URL: https://github.com/apache/incubator-tvm/pull/4338#discussion_r346467131
 
 

 ##########
 File path: tests/python/relay/test_autotvm_task_extraction.py
 ##########
 @@ -79,5 +79,20 @@ def test_task_extraction():
                                                        ops=(relay.op.nn.conv2d,))
     assert len(tasks) == 31
 
+def test_task_extraction_template_key():
+    """test task extraction using non-'direct' template_key"""
+    target = 'llvm'
+
+    shape_factor = 64
+    data = relay.var('data', shape=(shape_factor, shape_factor), dtype='float32')
+    dense = relay.nn.dense(data=data, weight=relay.var('weight'), units=shape_factor)
+    mod, params = relay.testing.init.create_workload(dense)
+    tasks = autotvm.task.extract_from_program(mod['main'], target=target,
+                                              params=params,
+                                              ops=(relay.op.nn.dense,),
+                                              template_key='direct_nopack')
+    assert len(tasks) == 1
 
 Review comment:
   Should check if the generated task is using the specified template key instead of task number, and it would be better to test more than one ops (e.g., conv2d direct/winograd).

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


With regards,
Apache Git Services