cxx122 opened a new issue, #12375:
URL: https://github.com/apache/tvm/issues/12375

   ```
   tensor_0 = te.placeholder([2,2,2], dtype="float16", name="TENSOR_0")
   tensor_1 = te.placeholder([2,2], dtype="bool", name="TENSOR_1")
   tensor_2 = te.compute([2,2], lambda 
icq,wcd:tensor_0[icq,icq,wcd]*tensor_1[wcd,wcd], name ="TENSOR_2")
   ```
   This te program will produce tir program like  `cast(bool, 
TENSOR_1[(wcd*3)])`, which will cause a core dump.
   
   ### Expected behavior
   
   `passed`
   
   ### Actual behavior
   
   ```
   @main = primfn(TENSOR_0_1: handle, TENSOR_1_1: handle, TENSOR_2_1: handle) 
-> ()
     attr = {"from_legacy_te_schedule": True, "global_symbol": "main", 
"tir.noalias": True}
     buffers = {TENSOR_0: Buffer(TENSOR_0_2: Pointer(float16), float16, [8], 
[]),
                TENSOR_1: Buffer(TENSOR_1_2: Pointer(int8), int8, [4], []),
                TENSOR_2: Buffer(TENSOR_2_2: Pointer(float16), float16, [4], 
[])}
     buffer_map = {TENSOR_0_1: TENSOR_0, TENSOR_1_1: TENSOR_1, TENSOR_2_1: 
TENSOR_2}
     preflattened_buffer_map = {TENSOR_0_1: TENSOR_0_3: Buffer(TENSOR_0_2, 
float16, [2, 2, 2], []), TENSOR_1_1: TENSOR_1_3: Buffer(TENSOR_1_2, bool, [2, 
2], []), TENSOR_2_1: TENSOR_2_3: Buffer(TENSOR_2_2, float16, [2, 2], [])} {
     for (icq: int32, 0, 2) {
       for (wcd: int32, 0, 2) {
         TENSOR_2[((icq*2) + wcd)] = (TENSOR_0[((icq*6) + wcd)]*cast(float16, 
cast(bool, TENSOR_1[(wcd*3)])))
       }
     }
   }
   
   
   Segmentation fault (core dumped)
   ```
   
   ### Environment
   
   Operating System: Ubuntu 18.04, TVM version: tag0.9.0 [d361585]
   
   ### Steps to reproduce
   
   ```
   import os
   import numpy as np
   import tvm
   from tvm import te, auto_scheduler, topi
   import tvm.testing
   
   tensor_0 = te.placeholder([2,2,2], dtype="float16", name="TENSOR_0")
   tensor_1 = te.placeholder([2,2], dtype="bool", name="TENSOR_1")
   tensor_2 = te.compute([2,2], lambda 
icq,wcd:tensor_0[icq,icq,wcd]*tensor_1[wcd,wcd], name ="TENSOR_2")
   s = te.create_schedule(tensor_2.op)
   tensor_list = [tensor_0, tensor_1, tensor_2]
   
   dev = tvm.cpu(0)
   pre_list = []
   for tensor in tensor_list:
       shape = [x.value if 'value' in dir(x) and isinstance(x.value, int) else 
1 for x in tensor.shape]
       params = (5*np.random.uniform(size=shape)+1).astype(tensor.dtype)
       pre_list.append(tvm.nd.array(params.copy(), dev))
   
   print(tvm.lower(s, tensor_list, simple_mode=True))
   f = tvm.build(s, tensor_list, "llvm")
   f(*pre_list)
   
   print("passed")
   
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to