Skip to content

Commit 25f5a15

Browse files
authored
[Enhancement] Improve layout inference accuracy in ParallelOp (#441) (#442)
* Added logic to use non-replicated buffers as source buffers for more accurate layout inference. * Enhanced comments to clarify the rationale behind buffer selection in layout inference process.
1 parent 4f82958 commit 25f5a15

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/op/parallel.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ LayoutMap ParallelOp::InferLayout(const LayoutInferArgs &T, InferLevel level) {
163163
indice_map_[read_source_buffer].size()) {
164164
read_source_buffer = buffer;
165165
}
166+
// If the buffer is not replicated, use it as source_buffer
167+
// because the layout inference is more accurate
168+
if (is_one(frag->ReplicateExtent())) {
169+
source_buffer = buffer;
170+
}
166171
}
167172
}
168173
}

0 commit comments

Comments
 (0)