sjain58 opened a new pull request, #15806: URL: https://github.com/apache/tvm/pull/15806
In Mobilenet float32, we see this sequence of ops: %179 = squeeze(%178, axis=[2, 3]) /* ty=Tensor[(1, 1001), float16] span=MobilenetEdgeTPU/Logits/Squeeze:0:0 /; %180 = reshape(%179, newshape=[-1, 1001]) / ty=Tensor[(1, 1001), float16] span=MobilenetEdgeTPU/Predictions/ Reshape:0:0 */; which later gets transformed to lv171 = R.call_tir(cls.primfunc_hmx_conv2d26_add20, (lv169, metadata["relax.expr.Constant"][116], metadata["relax.expr.Constant"][117]), out_sinfo=R.Tensor((1, 1001, 1, 1), dtype="float16")) lv172: R.Tensor((1, 1001), dtype="float16") = R.reshape(lv171, R.shape([1, 1001])) lv173: R.Tensor((1, 1001), dtype="float16") = R.reshape(lv172, R.shape([1, 1001])) We can eliminate the redundant reshape. lv171 = R.call_tir(cls.primfunc_hmx_conv2d26_add20, (lv169, metadata["relax.expr.Constant"][116], metadata["relax.expr.Constant"][117]), out_sinfo=R.Tensor((1, 1001, 1, 1), dtype="float16")) lv173: R.Tensor((1, 1001), dtype="float16") = R.reshape(lv171, R.shape([1, 1001])) -- 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]
