def suppress_output(rank):  
    """Suppress output for all processes except the one with rank 0."""  
    if rank != 0:  
        sys.stdout = open(os.devnull, 'w')
Suppress output for all processes except the one with rank 0.
LatentLM/inference_speed.py