# torch 2.15.0 (BSD-3-Clause), harvested by tools/harvest_corpus.py
=== input

    Identifies all reduce_scatter nodes and groups them into buckets,
        based on size limit `bucket_cap_mb_by_bucket_idx`.

    Args:
        gm (torch.fx.GraphModule): GraphModule where to bucket reduce_scatters.
        bucket_cap_mb_by_bucket_idx (Callable[[int], float]): Callable to specify cap of the bucket
            in megabytes by bucket idx.  The idea of `bucket_cap_mb_by_bucket_idx` is to allow
            specifying different sizes of the buckets.
        filter_wait_node (Callable[[torch.fx.Node], bool] | None): If specified,
            only reduce_scatter nodes with wait_node that satisfy `filter_wait_node` will be bucketed.

    Returns:
        list[list[torch.fx.Node]]: List of buckets, where each bucket is a list of reduce_scatter nodes.
    
=== parse google
short_description: 'Identifies all reduce_scatter nodes and groups them into buckets,'
long_description: '    based on size limit `bucket_cap_mb_by_bucket_idx`.'
blank_after_short_description: False
blank_after_long_description: True
style: google
- DocstringParam
  description: 'GraphModule where to bucket reduce_scatters.'
  kind: param
  key: 'param'
  arg_name: 'gm'
  type_name: 'torch.fx.GraphModule'
  is_optional: False
- DocstringParam
  description: |
    Callable to specify cap of the bucket
    in megabytes by bucket idx.  The idea of `bucket_cap_mb_by_bucket_idx` is to allow
    specifying different sizes of the buckets.
  kind: param
  key: 'param'
  arg_name: 'bucket_cap_mb_by_bucket_idx'
  type_name: 'Callable[[int], float]'
  is_optional: False
- DocstringParam
  description: |
    If specified,
    only reduce_scatter nodes with wait_node that satisfy `filter_wait_node` will be bucketed.
  kind: param
  key: 'param'
  arg_name: 'filter_wait_node'
  type_name: 'Callable[[torch.fx.Node], bool] | None'
  is_optional: False
- DocstringReturns
  description: 'List of buckets, where each bucket is a list of reduce_scatter nodes.'
  kind: returns
  key: 'returns'
  type_name: 'list[list[torch.fx.Node]]'
  is_generator: False
=== detect
google
=== compose google
Identifies all reduce_scatter nodes and groups them into buckets,
    based on size limit `bucket_cap_mb_by_bucket_idx`.

Args:
    gm (torch.fx.GraphModule): GraphModule where to bucket reduce_scatters.
    bucket_cap_mb_by_bucket_idx (Callable[[int], float]): Callable to specify cap of the bucket
        in megabytes by bucket idx.  The idea of `bucket_cap_mb_by_bucket_idx` is to allow
        specifying different sizes of the buckets.
    filter_wait_node (Callable[[torch.fx.Node], bool] | None): If specified,
        only reduce_scatter nodes with wait_node that satisfy `filter_wait_node` will be bucketed.

Returns:
    list[list[torch.fx.Node]]: List of buckets, where each bucket is a list of reduce_scatter nodes.
