masahi opened a new pull request, #13334:
URL: https://github.com/apache/tvm/pull/13334

   1. Workloads from quantized often have a trivial block which only produces a 
constant scalar:
   ```
   with T.block("compile_engine_const"):
       vi = T.axis.spatial(1, 0)
       T.reads()
       T.writes(compile_engine_const[()])
       compile_engine_const[()] = 59
   ```
   This can be inlined by existing `AutoInline` rule, but depending on the 
order where spatial blocks are processed by `AutoInline`, these 
"compile_engine_const" blocks can get in the way of `ReverseComputeInline` on 
other blocks, since the constant blocks also counted as a producer block. 
`PostOrderApply` currently processes the constant blocks at the very end, so 
`ReverseComputeInline` on blocks that consumes such constants always fail to 
inline. So in practice, we are not generating a fused kernel for quantized 
conv2d today.
   
   I added a simple inlining rule that inlines only such constant blocks. This 
rule is supposed to run before `AutoInline`, to unblock `ReverseComputeInline`. 
This lets us generate a fused kernel. On the int8 resnet50 model from PyTorch, 
the e2e perf improved from 6.8 to 5.2 msec, using batch size 16, and the same 
number of trials.   


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