{"slug": "how-to-automatically-find-the-batch-size-when-using-accelerate-with-fsdp2-d", "title": "How to automatically find the batch size when using Accelerate with FSDP2? [D]", "summary": "A user is asking how to replicate Hugging Face SFTTrainer's auto_find_batch_size=True behavior, which automatically reduces batch size after a CUDA out-of-memory error, when training across multiple GPUs on a single node with Accelerate and FSDP2. The question notes the single-GPU workflow works but seeks equivalent automatic batch-size discovery for the multi-GPU FSDP2 setup.", "body_md": "Hi, For single-GPU training, I’m using Hugging Face SFTTrainer with auto_find_batch_size=True, which automatically reduces the batch size after a CUDA OOM until it finds a batch size that works. I would like to have similar behavior when training on multiple GPUs on a single node using accelerate la", "url": "https://wpnews.pro/news/how-to-automatically-find-the-batch-size-when-using-accelerate-with-fsdp2-d", "canonical_source": "https://aiflash.com/news/119698/", "published_at": "2026-09-14 21:00:44+00:00", "updated_at": "2026-09-14 22:59:05.273275+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-infrastructure"], "entities": ["Hugging Face", "SFTTrainer", "Accelerate", "FSDP2", "CUDA"], "alternates": {"html": "https://wpnews.pro/news/how-to-automatically-find-the-batch-size-when-using-accelerate-with-fsdp2-d", "markdown": "https://wpnews.pro/news/how-to-automatically-find-the-batch-size-when-using-accelerate-with-fsdp2-d.md", "text": "https://wpnews.pro/news/how-to-automatically-find-the-batch-size-when-using-accelerate-with-fsdp2-d.txt", "jsonld": "https://wpnews.pro/news/how-to-automatically-find-the-batch-size-when-using-accelerate-with-fsdp2-d.jsonld"}}