all_gather_into_tensor is deprecated, _gpu_gather warns on every gather
Author: qgallouedecCreated Sep 16, 2026Updated Sep 16, 2026
System Info
accelerate 1.15.0, torch 2.13.0+cu129, transformers 5.18.0.dev0, 8 x H100.
Information
- The official example scripts
- My own modified scripts
Reproduction
_gpu_gather uses an API torch deprecated, so every Accelerator.gather logs a FutureWarning once per rank:
torch/distributed/c10d_logger.py:83: FutureWarning: `torch.distributed.all_gather_into_tensor` is deprecated.
Please use `torch.distributed.all_gather_single` instead.# utils/operations.py:324
gather_op = torch.distributed.all_gather_into_tensorIt is reached from any Trainer run, Trainer._get_num_items_in_batch -> Accelerator.gather -> _gpu_gather -> _gpu_gather_one.
Expected behavior
No warning. torch.distributed.all_gather_single exists in torch 2.13, so this can be a rename behind a version check for older torch.
Source: huggingface/accelerate