Lunderberg commented on a change in pull request #39:
URL: https://github.com/apache/tvm-rfcs/pull/39#discussion_r745678411



##########
File path: rfcs/0039-buffer-physical-layout.md
##########
@@ -0,0 +1,640 @@
+- Feature Name: Buffer Physical Layout
+- Authors: Eric Lunderberg (@Lunderberg), Wuwei Lin (@vinx13)
+- Start Date: 2021-10-05
+- RFC PR: [apache/tvm-rfcs#0039](https://github.com/apache/tvm-rfcs/pull/0039)
+- GitHub Issue: Not Yet Written
+- Related RFCs: [RFC#0042](https://github.com/apache/tvm-rfcs/pull/0042)
+
+# Summary
+[summary]: #summary
+
+This RFC introduces layout transformations that can be applies to a
+buffer during the lowering process.  These transformations will be
+part of the schedule, allowing the same compute definition to be used
+across multiple different layouts.
+
+[RFC#0042](https://github.com/apache/tvm-rfcs/pull/0042) is intended
+to make these buffer transformations easier to write, though it isn't
+strictly necessary for this change.
+
+# Motivation
+[motivation]: #motivation
+
+Currently, TVM assumes that all buffers can be treated as flat memory.
+That is, while a tensor may have N dimensions, the underlying buffer
+allocated by the low-level codegen has a single value defining the
+size, and access into that buffer is done using a single index.  This
+assumptions holds for most cases, such as a CPU accessing RAM, but
+doesn't hold in all cases.  For example, texture memory on a GPU
+requires two indices to access.
+
+In addition, computations that are semantically identical (e.g. 2-d

Review comment:
       That part was intended to lead into the "including the option to present 
multi-dimensional indices to the low-level code generators" phrase a few 
paragraphs down.  That the first two paragraphs in the Motivation section 
describe portions of the TVM codebase that could be improved, and the third 
indicates how these improvements would be made.
   
   I'll add a clarifying sentence "These are currently handled on a 
case-by-case basis, such as using `tvm::tir::builtin::texture2d_store` in a 
`CallNode`." so that the first paragraph connects better with the third.




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