adstraw commented on a change in pull request #8825:
URL: https://github.com/apache/tvm/pull/8825#discussion_r696757634
##########
File path: tutorials/optimize/opt_gemm.py
##########
@@ -293,23 +300,26 @@
# Allocate write cache
CC = s.cache_write(C, "global")
-xo, yo, xi, yi = s[C].tile(C.op.axis[0], C.op.axis[1], bn, bn)
+mo, no, mi, ni = s[C].tile(C.op.axis[0], C.op.axis[1], bn, bn)
-# Write cache is computed at yo
-s[CC].compute_at(s[C], yo)
+# Write cache is computed at no
+s[CC].compute_at(s[C], no)
# New inner axes
-xc, yc = s[CC].op.axis
+mc, nc = s[CC].op.axis
(k,) = s[CC].op.reduce_axis
-ko, ki = s[CC].split(k, factor=4)
-s[CC].reorder(ko, xc, ki, yc)
+ko, ki = s[CC].split(k, factor=kfactor)
+s[CC].reorder(ko, mc, ki, nc)
+s[CC].vectorize(nc)
+
+# unroll kfactor loops
+# this is a separate optimization not discussed in this tutorial
Review comment:
I added a "TODO" to add the unroll step to the tutorial per @tmoreau89's
suggestion.
Also stole @YuchenJin's comment and added that as well.
##########
File path: tutorials/optimize/opt_gemm.py
##########
@@ -227,43 +228,49 @@
###################################################################################################
# Array Packing
# -------------
-# Another important trick is array packing. This trick is to reorder the
storage dimension of the
-# array to convert the continuous access pattern on certain dimension to a
sequential pattern after
+# Another important trick is array packing. This trick is to reorder the
storage dimension of an
+# array to convert the continuous access pattern on its dimensions to a
sequential pattern after
# flattening.
#
# .. image::
https://github.com/dmlc/web-data/raw/main/tvm/tutorial/array-packing.png
# :align: center
#
+# NOTE: The figure above is meant for illustration purposes only. Please
ignore dimension
Review comment:
Done.
--
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]