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/06/01 22:02:41 UTC

[GitHub] [incubator-tvm] mole10 opened a new issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

mole10 opened a new issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710


   Hello all,
   
   I believe there is a bug within OpenCL codegen which results in a typo in data type identifiers. I am recently observing undefined type identifiers such as 'float44' and 'float88' in generated OpenCL codes. Here is an example.
   <pre><code>
   vstore4(((float44)(((__global float*)placeholder)[_1.s0],((__global float*)placeholder)[_1.s1],((__global float*)placeholder)[_1.s2],((__global float*)placeholder)[_1.s3])), 0, (__global float*)kernel_vec + ((((int)get_group_id(0)) * 1024) + (((int)get_local_id(0)) * 4)));
   </pre></code>
   I also found the similar problem in this post https://discuss.tvm.ai/t/bug-tvm-generate-wrong-opencl-code/6658. Here is my code to replicate this error:
   
   <pre><code>
   import numpy as np
   import topi
   import tvm 
   
   target = tvm.target.create("opencl -device=mali")
   target_host = 'llvm'
   
   dshape = (1, 64, 224, 224)
   kshape = (64, 64, 3, 3)
   
   data = tvm.te.placeholder(dshape)
   kernel = tvm.te.placeholder(kshape)
   
   with target:
       conv = topi.mali.conv2d_nchw_spatial_pack(data, kernel, [1,1], [1,1,1,1], [1,1],"float32" )
       sch = topi.mali.schedule_conv2d_nchw_spatial_pack([conv])
       mod = tvm.build(sch, [data, kernel], target, target_host )
       print("------opencl code------")
       print(mod.imported_modules[0].get_source())
   </pre></code>
   The printed code will contain a 'float44' as shown in the example above.
   
   In addtion, my investigation of the cause leads to commit d2e58ad2fd92c09dffe064e4efbfc484cf2de6e5
   https://github.com/apache/incubator-tvm/blob/d2e58ad2fd92c09dffe064e4efbfc484cf2de6e5/src/target/source/codegen_c.cc#L963
   
   @tqchen @huochaitiantang @kevinthesun Could you please help to confirm if "t.lanes()" is unnecessary here.
   
   Thank you!


----------------------------------------------------------------
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 edited a comment on issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

Posted by GitBox <gi...@apache.org>.
tqchen edited a comment on issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710#issuecomment-637156680


   cc @kazum @kevinthesun @huochaitiantang@vinx13  please see if you can send a fix.


----------------------------------------------------------------
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 issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710#issuecomment-637156680


   cc @kazum @kevinthesun @vinx13  please help confirm the issue


----------------------------------------------------------------
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] vinx13 commented on issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

Posted by GitBox <gi...@apache.org>.
vinx13 commented on issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710#issuecomment-638058179


   I think printing `t.lanes()` here is unnecessary, a patch is welcomed


----------------------------------------------------------------
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] abergeron commented on issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

Posted by GitBox <gi...@apache.org>.
abergeron commented on issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710#issuecomment-638342817


   This seems similar to what I've seen in #5704.


----------------------------------------------------------------
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 issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710#issuecomment-638470243


   fixed by  #5722 thanks to @abergeron 


----------------------------------------------------------------
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 closed issue #5710: [BUG][CODEGEN][OPENCL]Invalid data type in generated OpenCL kernel

Posted by GitBox <gi...@apache.org>.
tqchen closed issue #5710:
URL: https://github.com/apache/incubator-tvm/issues/5710


   


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