Commit d7206533 authored by Chao Liu's avatar Chao Liu
Browse files

add comment

parent 6805df0e
...@@ -8,10 +8,18 @@ ...@@ -8,10 +8,18 @@
namespace ck { namespace ck {
// this version does following things to avoid scratch memory issue // Thread-group level multi-source, multi-destination tensor slice data movement
// 1. Use StaticallyIndexedArray instead of C array for thread buffer // Assume:
// 2. ThreadwiseTensorSliceTransfer_v3 does not keep reference to tensor descriptor // 1. All sources and destinations are DynamicBuffer
// 3. ThreadwiseTensorSliceTransfer_v3::Run() does not construct new tensor coordinate // 2. Same VectorDim and ScalerPerVector for all sources and destinations
// 3. DstInMemOps are per destination tensor
// 4. ThreadTransferSrcResetCoordinateAfterRunFlags are per source tensor
// 5. ThreadTransferDstResetCoordinateAfterRunFlags are per destination tensor
//
// Does following things to avoid scratch memory issue
// 1. Pass tensor descritpors by reference (or tuple of references)
// 2. Does not keep reference to tensor descriptor
// 3. Does not construct new tensor coordinate when call Run()
template <typename ThreadGroup, template <typename ThreadGroup,
typename SrcDatas, typename SrcDatas,
typename DstDatas, typename DstDatas,
......
...@@ -7,17 +7,21 @@ ...@@ -7,17 +7,21 @@
namespace ck { namespace ck {
// Thread-level multi-source, multi-destination tensor slice data movement
// Assume: // Assume:
// 1. src_descs and dst_descs are not known at compile-time // 1. All sources and destinations are DynamicBuffer
// 2. SrcBuffers and DstBuffers are DynamicBuffer // 2. Same VectorDim and ScalerPerVector for all sources and destinations
// 3. src_slice_origins and dst_slice_origins are not known at compile-time, // 3. DstInMemOps are per destination tensor
// Do following things to avoid "alloca" in LLVM-IR, which would cause scratch memory // 4. ThreadTransferSrcResetCoordinateAfterRunFlags are per source tensor
// and sometimes useless instructions: // 5. ThreadTransferDstResetCoordinateAfterRunFlags are per destination tensor
// 1. Don't save a reference to tensor descriptor in class, pass in tensor descriptor as argument // 6. Does not need to know src_descs and dst_descs at compile-time
// instead // 7. Does not need to know src_slice_origins and dst_slice_origins at compile-time,
// 2. Don't construct a new tensor coordinate everytime when using it, update and reuse the same //
// tensor coordinate instead // Does following things to avoid scratch memory issue
// 3. Don't use a pointer to VGPR buffer, use vector instead // 1. Use StaticallyIndexedArray or vector_type instead of C array for thread buffer
// 2. Pass tensor descritpors by reference (or tuple of references)
// 3. Does not keep reference to tensor descriptor
// 4. Does not construct new tensor coordinate when call Run()
template <typename SrcDatas, template <typename SrcDatas,
typename DstDatas, typename DstDatas,
typename SrcDescs, typename SrcDescs,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment