How to automatically find the batch size when using Accelerate with FSDP2? [D]
Mirrored from r/MachineLearning for archival readability. Support the source by reading on the original site.
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 launch with FSDP2.
Is there a supported way to automatically determine or reduce the batch size when using Accelerate + FSDP2?
In particular, I’m wondering how this should be handled when one of the distributed processes encounters a CUDA OOM. Can Accelerate restart the distributed training with a smaller batch size, or does this need to be implemented externally?
If this is not well supported with FSDP2, what multi-GPU training approach would you recommend if automatic batch-size detection/recovery is an important requirement?
Thanks!
[link] [comments]
More from r/MachineLearning
-
Qwen3-VL 8B on a laptop vs Opus 5.5 / Sonnet 5 / GPT-5.6 on 137 messy documents: beat GPT-5.6 on tax forms, lost badly on Indian date formats[R]
Sep 28
-
How can I turn an industry ML project into a publication? [R]
Sep 28
-
Are there any good research papers around Text clustering using LLMs [R]
Sep 28
-
Free, open-source AI engineering course where you build each algorithm by hand: 523 lessons, now as EPUB/PDF books [P]
Sep 28
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.