Adding some additional discussion with @csullivan . We agree that: - There are different ways to encode layout and padding decisions: - E0: BufferConstraint(as element in the IR) - E1: Composing a stage that transforms the layout(a loop that represents the mapping) - Non-local rewrites are needed to be able to propagate the layout and padding decision through out the entire model through constraint solving.
Right now we have some healthy discussions about ways to encode layout and padding decisions. Some of my thoughts: Introducing changes to TIR would needs some additional thoughts that deserves some extra consideration. Due to the N*M complexity (where N is the TIR possibilities and M is the number of primitives to be supported). Right now it is possible to do non-local constraint rewriting flowings as part of the graph pass. Note that while E1 is indeed less "compact" on one hand, we can use it to reconstruct THE compact data structure(that represents the layout decision) that we can use to flow the decisions across the graph node. E1 also enables some additional capabilities (e.g.) expressing future memory remappings that do not necessarily fit into padding/packing. Starting from the graph level allows us to capture learnings, then use some e2e goals to make an informed decision on TIR level change later if needed. -- Reply to this email directly or view it on GitHub: https://github.com/apache/tvm-rfcs/pull/77#issuecomment-1156407362 You are receiving this because you are subscribed to this thread. Message ID: <apache/tvm-rfcs/pull/77/c1156407...@github.com>