def dedup_symbolic_name(sorted_graph: List[Tensor]) -> None:
    """Rename all shape variable that are identical to the same name.
    Parameters
    ----------
    sorted_graph : List[Tensor]
        Input graph to be simplified
    """
    symbolic_to_name = {}
    global user_provided_dim
    # First pass - build symbolic_to_name map
    for i, dim in _all_dims_in_graph(sorted_graph):
        if not _dim_qualified_for_sym_dedup(dim):
            continue
        dim_sym = dim.symbolic_value()
        if (
            dim_sym not in symbolic_to_name
            or dim_sym in symbolic_to_name
            and dim._attrs["name"] in user_provided_dim
        ):
            symbolic_to_name[dim_sym] = dim._attrs["name"] or f"dim_{i}"

    # Second pass - use symbolic_to_name map
    for _, dim in _all_dims_in_graph(sorted_graph):
        if not _dim_qualified_for_sym_dedup(dim):
            continue
        dim_sym = dim.symbolic_value()
        dim._attrs["name"] = symbolic_to_name[dim_sym]
Rename all shape variable that are identical to the same name.
    Parameters
    ----------
    sorted_graph : List[Tensor]
        Input graph to be simplified
    
python/aitemplate/compiler/transform/name_graph.py