Skip to content

Commit

Permalink
documentation: move num_chunks doc comment in ConvertApplyOpPattern (#…
Browse files Browse the repository at this point in the history
…3770)

Makes the doc comment more localized and is rendered better in the
online doc (upcoming).
  • Loading branch information
superlopuh authored Jan 20, 2025
1 parent 34e1697 commit 8d8848c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions xdsl/transforms/convert_stencil_to_csl_stencil.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,20 @@ class ConvertApplyOpPattern(RewritePattern):
"""
Fuses a `csl_stencil.prefetch` and a `stencil.apply` to build a `csl_stencil.apply`.
If there are several candidate prefetch ops, the one with the largest result buffer size is selected.
The selection is greedy, and could in the future be expanded into a more global selection optimising for minimal
prefetch overhead across multiple apply ops.
args:
num_chunks - number of chunks into which communication and computation should be split.
Effectively, the number of times `csl_stencil.apply.receive_chunk` will be executed and the
tensor sizes it handles. Higher values may increase compute overhead but reduce size of
communication buffers when lowered.
If there are several candidate prefetch ops, the one with the largest result buffer
size is selected.
The selection is greedy, and could in the future be expanded into a more global
selection optimising for minimal prefetch overhead across multiple apply ops.
"""

num_chunks: int = 1
"""
Number of chunks into which communication and computation should be split.
Effectively, the number of times `csl_stencil.apply.receive_chunk` will be executed
and the tensor sizes it handles.
Higher values may increase compute overhead but reduce size of communication buffers
when lowered.
"""

@op_type_rewrite_pattern
def match_and_rewrite(self, op: stencil.ApplyOp, rewriter: PatternRewriter, /):
Expand Down

0 comments on commit 8d8848c

Please sign in to comment.