def METHOD_NAME():
    if paddle.distributed.get_world_size() == 1:
        return 0
    hcg = get_hcg()
    dp_rank = hcg.get_data_parallel_rank()
    sharding_rank = hcg.get_sharding_parallel_rank()
    sharding_size = hcg.get_sharding_parallel_world_size()
    return dp_rank * sharding_size + sharding_rank