Anndrey24 commented on code in PR #16106:
URL: https://github.com/apache/tvm/pull/16106#discussion_r1400897859


##########
python/tvm/relay/op/strategy/arm_cpu.py:
##########
@@ -232,7 +232,7 @@ def conv2d_strategy_arm_cpu(attrs, inputs, out_type, 
target):
                             
wrap_topi_schedule(topi.arm_cpu.schedule_conv2d_NHWC_quantized_native),
                             name="conv2d_NHWC_quantized_native.arm_cpu",
                         )
-                    if is_aarch64 and has_asimd:
+                    if has_asimd:

Review Comment:
   Right, at this point we can remove the `if has_asimd`condition completely, 
so I'll at least do that.  
   
   From my understanding, the reason we are adding the implementations as 
"interleaved", "native", and then "interleaved" again is to make use of the 
fact that when two implementations have the same priority level, the one added 
to the strategy first is selected by default.  
   We currently want the default to be:
   
   - both i8mm & dotprod enabled: interleaved
   - i8mm: interleaved
   - dotprod: native
   - neither (only aarch64): interleaved
   
   We could replace the entire int8 strategy selection with  
   ```
   if has_dot_prod and not has_matmul_i8:
       strategy.add_implementation(
           
wrap_compute_conv2d(topi.arm_cpu.compute_conv2d_NHWC_quantized_native),
           
wrap_topi_schedule(topi.arm_cpu.schedule_conv2d_NHWC_quantized_native),
           name="conv2d_NHWC_quantized_native.arm_cpu",
       )
   strategy.add_implementation(
       wrap_compute_conv2d(
           topi.arm_cpu.compute_conv2d_NHWC_quantized_interleaved
       ),
       wrap_topi_schedule(
           topi.arm_cpu.schedule_conv2d_NHWC_quantized_interleaved
       ),
       name="conv2d_NHWC_quantized_interleaved.arm_cpu",
   )
   ```
   but I guess this wouldn't allow autoTVM to select between the 2 
implementations when both i8mm and dotprod are enabled.  
   Which way do you think is best?



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