For PR #5468, better solution for PredictionCollection `allgather_predictions`  in distributed setting.
This function makes several assumptions:

The number of batches seen on all batches is the same.
Every element of the dictionary can be converted into a tensor with current implementation of LightningModule.all_gather

Better approach:

Each process saves it own predictions and only rank 0 reload them -> Find a deadlock on loading file from other processes and couldn't find a fix.