Skip to content

Commit

Permalink
documentation: move num_chunks doc comment in ConvertApplyOpPattern
Browse files Browse the repository at this point in the history
  • Loading branch information
superlopuh committed Jan 20, 2025
1 parent 34e1697 commit d2a3fc2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 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,19 @@ 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 d2a3fc2

Please sign in to comment.