def fuse_parallel_gemms(
    sorted_graph: List[Tensor], workdir: str = None
) -> List[Tensor]:
    """Fuse parallel gemms into a single gemm op.
    Currently, we only support the following patterns:

    - parallel gemm + concat
    - split->parallel gemm->concat

    Parameters
    ----------
    sorted_graph : List[Tensor]
        Input graph
    workdir : str, optional
        working dir, by default None

    Returns
    -------
    List[Tensor]
        Fused graph
    """
    funcs = [
        _fuse_parallel_gemm_concat,
        _fuse_split_parallel_gemm_concat,
    ]
    for func in funcs:
        sorted_graph = func(sorted_graph)
    return sorted_graph
Fuse parallel gemms into a single gemm op.
Currently, we only support the following patterns:

- parallel gemm + concat
- split->parallel gemm->concat

Parameters
----------
sorted_graph : List[Tensor]
Input graph
workdir : str, optional
working dir, by default None

Returns
-------
List[Tensor]
Fused graph
python/aitemplate/compiler/transform/fuse_parallel_gemms.py