anijain2305 opened a new pull request #4786: [TOPI][x86] Pad schedule 
improvment.
URL: https://github.com/apache/incubator-tvm/pull/4786
 
 
   While working on quantized mobilenet V2, I saw that pad operator was taking 
around 25% of total time on cascade lake machine. This PR optimized the 
schedule for Pad operator
   
   For following test
   
   Before PR - 80 us
   After PR - 6 us
   
   ~~~
   import numpy as np
   import tvm
   from tvm import relay
   from tvm.relay.op import register_pattern, OpPattern
   from tvm.contrib import graph_runtime
   from tvm.contrib.debugger import debug_runtime
   
   dtype='uint8'
   dshape=(1, 6, 114, 114, 16)
   
   x1 = relay.var("x1", shape=dshape, dtype=dtype)
   x2 = relay.nn.pad(x1, pad_width=((0, 0), (0, 0), (1, 1), (1, 1), (0, 0)))
   
   func = relay.Function([x1], x2)
   mod = relay.Module.from_expr(func)
   
   with relay.build_config(opt_level=3):
       graph, lib, params = relay.build(mod, target="llvm -mcpu=cascadelake")
   
   ctx = tvm.cpu()
   # module = graph_runtime.create(graph, lib, ctx)
   module = debug_runtime.create(graph, lib, ctx)
   module.run()
   ~~~
   
   
   @yzhliu @vinx13 @shoubhik please review

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


With regards,
Apache Git Services

Reply via email to