def _get_sorted_candidate_ops(
    sorted_ops: List[Operator], op_type: str, f_filter: Callable
) -> OrderedDict[Tensor, bool]:
    """Get all the candidate ops, `grouped: {op: flag}`, for group fusion. The flag
       denotes whether this op is grouped or not and is initialized to False. We need to
       filter out ops that are not eligible such as gemm ops with large m/n/k or odd
       alignment, or layernorm ops without gamma/beta etc.

    Args:
        sorted_ops (List[Operator]): Sorted ops from the graph
        op_type (str): The op type to be grouped

    Returns:
        OrderedDict[Tensor, bool]: All the candidate ops for group fusion
    """
    op_set = collections.OrderedDict()
    for op in sorted_ops:
        if op._attrs["op"] == op_type and f_filter(op):
            op_set[op] = False

    return op_set
Get all the candidate ops, `grouped: {op: flag}`, for group fusion. The flag
       denotes whether this op is grouped or not and is initialized to False. We need to
       filter out ops that are not eligible such as gemm ops with large m/n/k or odd
       alignment, or layernorm ops without gamma/beta etc.

    Args:
        sorted_ops (List[Operator]): Sorted ops from the graph
        op_type (str): The op type to be grouped

    Returns:
        OrderedDict[Tensor, bool]: All the candidate ops for group fusion
    
python/aitemplate/compiler/transform/fuse_group_ops.py